Auth0 Fails to Display Console Log Messages During Redirect Actions
Last Updated:
Overview
Auth0 fails to display console.log messages in the Action Execution tab when a Post-Login Action redirects a user to an external endpoint. This occurs because the Action suspends the authentication pipeline, and the user never returns to the /continue endpoint to complete the execution. Resume the authentication flow by redirecting the user back to the /continue endpoint and moving the logging logic to the onContinuePostLogin function to resolve the issue.
Applies To
- Actions
- User Redirect
- Action Execution Logs
Cause
The error occurs because the api.redirect.sendUserTo() method suspends the Actions pipeline. If the external application does not redirect the user back to the Auth0 /continue endpoint, the authentication flow never finishes. This prevents Auth0 from recording the console.log messages or the Successful Login event.
Solution
How does Auth0 record console log messages during a Redirect Action?
To resolve the logging issue, configure the external application to return the user to the Auth0 continue endpoint and move the logging logic to the continuation function.
- Navigate to the external application code that handles the redirect from Auth0.
- Configure the application to redirect the user back to the Auth0
/continueendpoint after completing the external process. - Navigate to the Auth0 Dashboard.
- Choose Actions and select Triggers.
- Select Post-Login to open the Post-Login flow.
- Select the relevant Action to open the editor.
- Move the
console.logstatements and any subsequent logic into theonContinuePostLoginfunction block so they execute after the authentication flow resumes. - Select Deploy to save and activate the Action.