Hello, I want to require email verification before signing in. If the user tries to sign in with out verifying their email I want Auth0 to resend the verification link and let the user know. For the most part I have gotten it working. My problem is the way I currently have it setup the action takes the user to the Callback page with the error message and a blank browser screen. After the action is done I want to redirect to another page that lets the user know what is going on. How do I redirect to such a page after the action is done. The following is my code for the Login Action and I am using a dependency auth0@2.35.0,
exports.onExecutePostLogin = async (event, api) => {
if (!event.user.email_verified) {
const ManagementClient = require(‘auth0’).ManagementClient;
const management = new ManagementClient({
domain: event.secrets.domain,
clientId: event.secrets.client_id,
clientSecret: event.secrets.client_secret,
});
var params = {
user_id: event.user.user_id
};
management.jobs.verifyEmail(params, function (err) {
if (err) {
console.log(err)
}
});
api.access.deny(‘Please verify your email before logging in.’);
}
};