18 lines
1.0 KiB
TypeScript
18 lines
1.0 KiB
TypeScript
import { PasswordForm } from '@/components/account/password-form';
|
|||
|
|
import { hasAccountPassword, requireUser } from '@/lib/server/auth';
|
||
|
|
|
||
|
|
export const runtime = 'nodejs';
|
||
|
|
export const dynamic = 'force-dynamic';
|
||
|
|
|
||
|
|
export default async function PasswordPage() {
|
||
|
|
const user = await requireUser('/account/password');
|
||
|
|
const passwordSet = hasAccountPassword(user.userId);
|
||
|
|
return <main className="account-page">
|
||
|
|
<div className="account-brand brand"><div className="brand-mark" aria-hidden="true"><i /><i /><i /><i /></div><div><strong>需有序</strong><span>需求协作平台</span></div></div>
|
||
|
|
<section className="account-card account-password-card" aria-labelledby="password-title">
|
||
|
|
<h1 id="password-title">{!passwordSet ? '设置系统密码' : user.mustChangePassword ? '设置你的密码' : '修改密码'}</h1>
|
||
|
|
<p className="account-intro">当前账号:<strong>{user.username}</strong></p>
|
||
|
|
<PasswordForm username={user.username} mustChangePassword={user.mustChangePassword} passwordSet={passwordSet} />
|
||
|
|
</section>
|
||
|
|
</main>;
|
||
|
|
}
|