Files
faunosteo/apps/app/src/auth/useMfaFailureMessage.ts
T
bchanot 4744e28986 feat(app): admin and catalogue entries, step-up guard, MFA in Mon compte (V1-2.5 E, F)
Nav hint from own grants and roles (never a control); RequireCatalog, RequireAdmin (no admin read before aal2), Accès non autorisé page, placeholder routes; TOTP factor list, enrolment with QR and one-time secret, removal, inline step-up for aal2 actions, step-up in password reset; auth kind aal2_required. App 601, e2e:ui 227.
2026-11-02 16:49:37 +01:00

9 lines
344 B
TypeScript

import { classifyMfaError } from '@faunosteo/supabase'
import { useT } from '@/i18n/useT'
/** One sentence per MFA failure kind (`mfa.failure.<kind>`); GoTrue's own message never shows. */
export function useMfaFailureMessage(): (error: unknown) => string {
const t = useT()
return (error) => t(`mfa.failure.${classifyMfaError(error)}`)
}