Redirect URI applied on Log-in Screen instead on Sign-up Screen only for existing users

  • Which SDK this is regarding: @auth0/auth0-spa-js
  • SDK Version: 1.6.5
  • Platform Version: e.g. Vue

Existing users use the signup screen, and if they click the Log In link on the bottom, then they are redirected to the redirect_uri for signups instead of logins.

How to replicate the problem:

  1. I am redirecting our users to the signup screen using the following code:
authService.loginWithRedirect({
    screen_hint: 'signup',
    redirect_uri: `${process.env.VUE_APP_FEED_BASE_URL}/registration-completed`
});

This code works, but many existing users will use this function to login.

  1. When they click on the Log In link at the bottom of the screen, they are redirected to the Login Screen, but the same redirect_uri is still used.

  2. As a result, existing users are redirected to /registration-completed and my analytics are not accurate.

What is a solution to this problem? Is it possible to select a different default URI for Logins? Even if the whole process was first initialized with:

redirect_uri: ${process.env.VUE_APP_FEED_BASE_URL}/registration-completed

I solved this by checking if the user was created in the last 30 seconds in order to know whether to fire the sign up events.

1 Like

Glad to hear that and thanks for sharing with the rest of community!