Skip to content

Commit 39bc38f

Browse files
Await admin MFA success callback
1 parent 8f8ab02 commit 39bc38f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/admin/dashboard/src/routes/login/components/mfa-challenge-card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { MfaChallengeForm } from "./mfa-challenge-form"
44

55
type MfaChallengeCardProps = {
66
challenge: AuthMfaChallenge
7-
onSuccess: (token: string) => void
7+
onSuccess: (token: string) => void | Promise<void>
88
onBack?: () => void
99
}
1010

packages/admin/dashboard/src/routes/login/components/mfa-challenge-form.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const getDefaultMethod = (
2020

2121
type MfaChallengeFormProps = {
2222
challenge: AuthMfaChallenge
23-
onSuccess: (token: string) => void
23+
onSuccess: (token: string) => void | Promise<void>
2424
onBack?: () => void
2525
}
2626

@@ -55,7 +55,7 @@ export const MfaChallengeForm = ({
5555
method,
5656
code: verificationCode,
5757
})
58-
onSuccess(token)
58+
await onSuccess(token)
5959
} catch (e) {
6060
setError(e instanceof Error ? e.message : t("login.mfa.verifyError"))
6161
setCode("")

0 commit comments

Comments
 (0)