feat: harden identity and recovery operations

This commit is contained in:
2026-08-04 20:24:18 +01:00
parent 7a4ac48aaf
commit eae2a44f46
30 changed files with 1428 additions and 21 deletions

View File

@@ -14,6 +14,12 @@ import { edit } from '@/routes/security';
type Props = {
passwordRules: string;
microsoft: {
enabled: boolean;
linked: boolean;
email: string | null;
lastLoginAt: string | null;
};
} & ManagePasskeysProps &
ManageTwoFactorProps;
@@ -133,6 +139,49 @@ export default function Security(props: Props) {
canManagePasskeys={props.canManagePasskeys}
passkeys={props.passkeys}
/>
{props.microsoft.enabled && (
<div className="space-y-6">
<Heading
variant="small"
title="Conta institucional Microsoft"
description="Associe explicitamente a identidade institucional para poder iniciar sessão pelo Microsoft Entra."
/>
{props.microsoft.linked ? (
<div className="space-y-4 rounded-lg border p-4">
<div>
<p className="font-medium">
Identidade associada
</p>
<p className="text-sm text-muted-foreground">
{props.microsoft.email}
</p>
</div>
<Form
method="delete"
action="/settings/microsoft-identity"
>
{({ processing }) => (
<Button
type="submit"
variant="destructive"
disabled={processing}
>
Remover associação
</Button>
)}
</Form>
</div>
) : (
<Button variant="outline" asChild>
<a href="/settings/microsoft-identity/redirect">
Associar conta Microsoft
</a>
</Button>
)}
</div>
)}
</>
);
}