Dynamic redirect to URL based on application name?

Some context: I have three applications named: local, stage and prod. Whenever a user signs up in my application, Auth0 sends them a verification email. I want the user to get redirected to a particular URL based on how they sign up(either locally, through stage or prod).
I tried doing this by configuring the Redirect To field in verification email dashboard. Like this:

Here’s the full value:

{% if application.name == 'local' %} http://localhost:4000/local {% elsif application.name == 'stage' %} https://<link-to-stage-app> {% else %} https://<link-to-prod> {% endif %}

But this doesn’t work. I always get redirected to prod link after verifying my email. What did I do wrong here? What should be the correct approach?


Solved it on my own! I didn’t realize my application name contained spaces :man_facepalming:

PS: The syntax above will work just fine. However, if you have spaces in your application name, the comparison should have encoded spaces. Ex. application.name == 'local%20app' instead of local app.

1 Like

Glad you have figured it out and thanks for sharing with the rest of community!

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