Skip to content

How to know if a user's 2FA is setup and enabled? #165

Answered by aeneasr
kaboomdev asked this question in Q&A
Discussion options

You must be logged in to vote

That's a great question! We don't have a dedicated API yet that shows what methods a user has set up, but we are working on adding this.

To work around this you can do the following:

  1. Disable "allow login without second factor" at https://console.ory.sh/projects/current/mfa
  2. In your app middleware, check what the aal is of the identity. If it is not aal2, it means that the user does not have MFA set up. If that is the case, redirect them to your settings page in the middleware

Hope this helps!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kaboomdev
Comment options

Answer selected by kaboomdev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants