Send some users to new frontend application

We got a new version of our frontend application. We want to roll it out slowly, so thinking about to have a environment meta data if the users should see the new or the current version.

I created a login action, dont think that the authentication and other variables are send. Is there a good way in auth0 or do we need to implement it into the frontend?

exports.onExecutePostLogin = async (event, api) => {
  if (
    event.organization != null
    && event.organization.metadata.new_frontend
  )
  {
    api.redirect.sendUserTo("https://my-app.example.com");
  }
};

For both version we have a client_id, so maybe change the client_id or something like that

Hi @rjansen88 and welcome back to the Auth0 Community!

Instead of forcing a redirect from within the Action, the recommended approach is to add a custom claim to the user’s ID Token. Your frontend application can then read this claim and decide whether to render the new or the current version. This decouples your authentication logic from your application’s routing.

Here is a knowledge article that goes into detail on how to add custom claims.

I wish you a great day!
Teodor.

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