import { motion } from 'motion/react'; import { ShieldAlert } from 'lucide-react'; import { Card, CardContent } from '@/components/ui/card'; import { ThemeToggle } from '@/components/theme-toggle'; import { ChangePasswordForm, type PasswordRule } from '@/components/pages/change-password-form'; // Re-exported so existing importers (e.g. the API client) keep resolving // `PasswordRule` from this module after the form was extracted. export type { PasswordRule }; interface ChangePasswordPageProps { /** * The password the user just logged in with. Passed straight through to the * form as `knownOldPassword`, so the forced flow never renders an * old-password field for a browser to autofill. See change-password-form. */ knownOldPassword?: string; title?: string; description?: string; checkStrength: (password: string) => Promise<{ rules: PasswordRule[]; valid: boolean }>; submit: (oldPassword: string, newPassword: string) => Promise<{ success: boolean; message?: string }>; onSuccess: () => void; } /** * Full-screen "you must set a new password before continuing" gate, shown * once right after the first login with a generated temp password. The * in-app "修改访问密码" action uses ChangePasswordDialog instead. */ export function ChangePasswordPage({ knownOldPassword, title = '请先设置新的访问密码', description = '为了保护你的实例,必须将首次启动生成的临时密码替换为符合下列要求的强密码。', checkStrength, submit, onSuccess, }: ChangePasswordPageProps) { return (
{description}