I’ve followed the documentation for the Omniauth Auth0 Gem in our rails app. I’m working on customizing error messages from clicking on a used passwordless link but cannot seem to get any error messages. The passwordless link works great the first time to log me in. I’d expect it to fail when trying to use the link again, but I’m looking to capture the specific error message coming from auth0.
The gem says to use request.params['message']
, but no params are being passed into my controller method. I have found that request.env['omniauth.error.type']
and request.env['omniauth.error'].message
are available but typically is just a csrf_detected
error type due to the session state not existing anymore. Pretty sure that’s happening here
My failure method then redirects the customer and upon redirection I see the auth0 error information getting attached to the URL as ANCHOR parameters (with a #).
Ex: https://myurl.com/random-page#error=unauthorized&error_description=Wrong%20email%20or%20verification%20code.&state=123xyzexample
How can I access the auth0 error type and description??