How do I show error message from Post-Login Action deny into auth0-lock?

I’m using Lock v13 with Google connection only (no email/password). I want to block emails by domain, and I do have the Action setup within the Post-Login trigger.

Now in the frontend code, I have listeners on a bunch of events on the Auth0Lock instance.

lock.on('authenticated', handleAuth);
lock.on('unrecoverable_error', handleAuth);
lock.on('authorization_error', handleAuth);
lock.on('signup error', handleAuth);
lock.on('hash_parsed', handleAuth);

For allowed emails, the “authenticated” event triggers fine. But for blocked emails, it’s not triggering any of those events. I do see a warn in the browser console:

There was an error fetching the SSO data. This could simply mean that there was a problem with the network. But, if a “Origin” error has been logged before this warning, please add “http://localhost:3000” to the “Allowed Web Origins” list in the Auth0 dashboard.

Is there a way to intercept the error from the Action to render in the UI (that their email is not allowed)?

1 Like

Hi @baohouse

Please check out these community posts regarding the matter which I believe can be helpful:

Let me know if you have any other questions!

Kind Regards,
Nik

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.