Skip to content

Commit

Permalink
fix(core): avoid logout before initiate totp
Browse files Browse the repository at this point in the history
  • Loading branch information
dolcalmi committed Oct 5, 2024
1 parent b891b3e commit 3b20f81
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/api/src/app/authentication/totp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ export const initiateTotpRegistration = async ({
if (authToken instanceof Error) {
return authToken
}
const initiateResponse = kratosInitiateTotp(authToken)
const initiateResponse = await kratosInitiateTotp(authToken)
if (initiateResponse instanceof Error) return initiateResponse

await logoutSessionByAuthToken(authToken)

return initiateResponse
}

Expand Down

0 comments on commit 3b20f81

Please sign in to comment.