Override callback post request nodejs auth0 openid connect

Hi. I am using nodejs with express for my rest api. I am using the auth config. Lets say the login fails, then the user gets redirected to localhost:3000/callback by default when using the auth config for express. However I want to override the post request for /callback, but still maintain most of the original functionality. I mainly just want to display the errors in a better way than a default error thrown from nodejs. For example the acces denied error, which happens when the user doesnt accept the tenant terms.

Hi @elias.knudsen

Welcome back to the Auth0 Community!

From the Auth0 perspective the detailed error message is passed in the returned callback request. Detailed parameters are showed here Customize Error Pages

on your side you will need to have a error handler that will check for errors from callback and render proper error message.

Thanks
Dawid

1 Like

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