Auth0 Fails to Display Console Log Messages During Redirect Actions

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.

  1. Navigate to the external application code that handles the redirect from Auth0.
  2. Configure the application to redirect the user back to the Auth0 /continue endpoint after completing the external process.
  3. Navigate to the Auth0 Dashboard.
  4. Choose Actions and select Triggers.
  5. Select Post-Login to open the Post-Login flow.
  6. Select the relevant Action to open the editor.
  7. Move the console.log statements and any subsequent logic into the onContinuePostLogin function block so they execute after the authentication flow resumes.
  8. Select Deploy to save and activate the Action.

Related References

Recommended content

No recommended content found...