I need to implement MFA (MFA pro - OTP) using our existing setup. In the below code, Auth0 handles the entire login process. I have activated MFA (OTP) for a user, however when logging in is not triggering an OTP prompt and the user logs in as usual.
Do I need to change the below code (perhaps using actions) to set up OTP MFA or does Auth0 handle that without the need for a code change?
const generateAuth = ({
AUTH0_DOMAIN,
AUTH0_CLIENT_ID,
}: {
AUTH0_DOMAIN: string;
AUTH0_CLIENT_ID: string;
}) =>
new WebAuth({
domain: AUTH0_DOMAIN,
clientID: AUTH0_CLIENT_ID,
redirectUri: `${window.location.origin}`,
audience: `https://${AUTH0_DOMAIN}/api/v2/`,
responseType: 'token id_token',
scope: 'openid email',
});
const auth0 = generateAuth({
AUTH0_DOMAIN: props.envs.AUTH0_DOMAIN,
AUTH0_CLIENT_ID: props.envs.AUTH0_CLIENT_ID,
});
const login = useCallback(() => {
// clear persistent_data on login
localStorage.removeItem('persistent_data');
const state = redirect.set();
auth0.authorize({
state,
});
}, [auth0]);