I changed the action to redirect, but it didn’t solve the problem (I still can’t go to the login form page):
exports.onExecutePostLogin = async (event, api) => {
if (!event.user.email_verified) {
api.redirect.sendUserTo(‘http://localhost:3000/error’, {
query: { message: ‘Please verify your email before logging in!’ }
});
}
};
I think that after an error, something is written to the cookie file, because if I delete it, I can go to the login/registration form. It also helps to call logout from useAuth0 to go to the login page (at the moment we have settled on this solution). Can you suggest something else?
Thanks for following up on this! I unfortunately do not have an alternate solution currently - I think calling logout instead may make the most sense here as this clears out the users session(s) entirely.