Omni-auth0 - failure error message always acces_denied

Hello,

I’m using omni-auth0 in our RoR application. I’ve added an PostLogin Action Flow, that simply deny access if user’s email is not verified

exports.onExecutePostLogin = async (event, api) => {
  if (!event.user.email_verified) {
    api.access.deny('You must verified your email first');
  }
};

Everything goes as expected but omniauth’s default failure endpoint message param is always acces_denied and I didn’t find a way to use the error_description params which is the reason we provided.

When looking in omniauth’s failure endpoint code, the message is equal to env['omniauth.error.type'] which is the message_key.

The message_key comes from omni-oauth2 gem where it is set to either error_reason or error.

Is there a way to callback with error_reason instead of error ? It makes sense whereas your api definition talks about a reason.