Post login flow - api.access.deny should display error on universal login screen

Ability to have api.access.deny() method display the provided reason in universal login screens rather than forwarding users to application

When I have an action, like below, that is part of the post login flow then I would like the ability to have the universal login screens to display the reason provided rather than forwarding onto my own application.

 exports.onExecutePostLogin = async (event, api) => {
  if (!event.user.email_verified) {
   api.access.deny('Please verify your email before logging in.');
 }
};

Use-case: This would be a much nicer flow for our users, simply displaying the message on the login screens, in the same way you would for an incorrect password or email address makes more sense than redirecting users to our app to see the message and us then just sending them back to login again.

Hi @ben.davidson,

Thanks for the detailed feedback request!

1 Like