fix(admin): remove operation-level email reauthentication
This commit is contained in:
@@ -22,7 +22,6 @@ type MfaStatus = {
|
||||
required: boolean;
|
||||
enrolled: boolean;
|
||||
verified: boolean;
|
||||
highRiskWritesEnabled: boolean;
|
||||
expiresIn?: number;
|
||||
};
|
||||
|
||||
@@ -104,7 +103,7 @@ export default function MfaSecurity() {
|
||||
if (!data) return;
|
||||
setStatus(data);
|
||||
setEnrollment(undefined);
|
||||
setNotice("当前管理员会话已完成真实第二因素验证。高风险操作仍需随后完成权限范围内的邮箱验证码。");
|
||||
setNotice("当前管理员会话已完成 MFA 验证。");
|
||||
}
|
||||
|
||||
async function recover({ code }: { code: string }) {
|
||||
@@ -131,8 +130,8 @@ export default function MfaSecurity() {
|
||||
setEnrollment(undefined);
|
||||
setBackupCodes(undefined);
|
||||
setNotice(data.required
|
||||
? "MFA 已禁用。该角色要求 MFA,因此高风险写入现已关闭,重新绑定后才能恢复。"
|
||||
: "MFA 已禁用,当前 MFA 与邮箱重认证证明均已撤销。");
|
||||
? "MFA 已禁用。当前角色要求启用 MFA,可随时重新绑定。"
|
||||
: "MFA 已禁用,当前会话的 MFA 证明已撤销。");
|
||||
}
|
||||
|
||||
if (loading && !status) {
|
||||
@@ -153,7 +152,7 @@ export default function MfaSecurity() {
|
||||
type="warning"
|
||||
showIcon
|
||||
message="当前角色强制要求 MFA"
|
||||
description="在 MFA 绑定完成前,所有高风险写入均默认拒绝。"
|
||||
description="这是账户级安全要求,不会再触发具体管理操作的邮箱验证码复核。"
|
||||
/> : null}
|
||||
|
||||
<Card title="当前状态">
|
||||
@@ -167,11 +166,6 @@ export default function MfaSecurity() {
|
||||
<Descriptions.Item label="当前会话">
|
||||
<Text type={status?.verified ? undefined : "secondary"}>{status?.verified ? "已验证" : "未验证"}</Text>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="高风险写入前置能力">
|
||||
<Text type={status?.highRiskWritesEnabled ? undefined : "danger"}>
|
||||
{status?.highRiskWritesEnabled ? "可发起邮箱重认证" : "已关闭"}
|
||||
</Text>
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</Card>
|
||||
|
||||
@@ -208,7 +202,7 @@ export default function MfaSecurity() {
|
||||
</Card> : null}
|
||||
|
||||
{status?.enrolled && !status.verified ? <Card title="验证当前会话">
|
||||
<Paragraph>高权限操作前,先用认证器验证码或一次性恢复码完成真实第二因素。</Paragraph>
|
||||
<Paragraph>可使用认证器验证码或一次性恢复码验证当前管理员会话。</Paragraph>
|
||||
<Radio.Group value={factor} onChange={(event) => setFactor(event.target.value as Factor)}>
|
||||
<Radio.Button value="totp">认证器验证码</Radio.Button>
|
||||
<Radio.Button value="backup">恢复码</Radio.Button>
|
||||
@@ -254,7 +248,7 @@ export default function MfaSecurity() {
|
||||
<Divider />
|
||||
<div>
|
||||
<Title level={4}>禁用 MFA</Title>
|
||||
<Paragraph type="secondary">禁用会轮换 Better Auth 会话,并撤销当前 MFA 与邮箱重认证证明。</Paragraph>
|
||||
<Paragraph type="secondary">禁用会轮换 Better Auth 会话,并撤销当前会话的 MFA 证明。</Paragraph>
|
||||
<Form layout="inline" onFinish={disable}>
|
||||
<Form.Item name="password" rules={[{ required: true, message: "请输入当前密码" }]}>
|
||||
<Input.Password placeholder="当前密码" autoComplete="current-password" maxLength={128} />
|
||||
|
||||
Reference in New Issue
Block a user