Rules: redirect on error, still have it show up in logs

We use Auth0 to provide SSO for a whole host of applications. During login, we use a bunch of rules to check things like authorization for that particular application.

If one of those checks results in an error, we used to just use something like return callback(new Error('error description'). However, that redirects back to the application and means we need to add error handling code to every single one of them (some are SaaS, so we can’t).

So, we decided to follow the folks at Mozilla and suggestions here on the community and use a redirect to a custom, self-hosted error page using context.redirect. However, that means Auth0 doesn’t know there was an error and it doesn’t show up in the logs.

Is there a ‘best of both worlds’ way of dealing with this? So redirect to a custom page on error, but have the failed login show up in the Auth0 logs?

Hey @thijmen96, I apologize for the delay in response.

I understand it has been some time since this question was asked but I wanted to touchbase and see if this is something that you are still battling. Please let me know if I could be of any assistance on this front. Thank you.

Hey @James.Morrison,

We haven’t really found a solution to this yet. I did leave feedback on this topic, but I got the response that right now my request simply isn’t possible.

I would love to hear your thoughts about this!

@Chipadeedoodah is a fantastic person to talk with on this front so it looks like you already gave your feedback to the perfect source! Thank you for sharing @thijmen96, we honestly appreciate it!

1 Like

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