Hey,
I have a NextJS app that I want to protect via optional OTP that the user can turn on/off if he wants. I already did the following:
- Enabled OTP in dashboard, but marked Require Multi-factor Auth as “Never”.
- In my app, I have a page that sets “mfa” key in user_metadata to true/false.
- Based on the value from #2, I have a onExecutePostLogin action that if mfa = true does api.multifactor.enable(“any”).
So far so good, everything is working perfectly. The thing is I’de like to do the enrolling part in my app, after user is already logged in. I saw these manuals:
https://community.auth0.com/t/how-to-set-up-mfa-totp-enrollment-with-mfa-api/85850
https://community.auth0.com/t/generate-qr-code-for-otp-enrollment/109003
But it’s not clear to me. I don’t hold the username and password of the user, so how can I
send a refresh token request if i don’t have the user credentials?
does is mean i need to force the user to re-login or is there’s another option I don’t think of?