How to prevent redirect on page landing

Hey everyone,

I’m using the Supabase email invite process where the user will be directed to my app: [domainname].com/invite and they’ll enter a password and create a profile.

Everything works until the user lands on the page, then is redirected to the project base domain with ‘/404/’ added.

For additional details:

  • no actions on page load or triggered workflows
  • no URL paths
  • no meta data
  • private access if off

Any ideas will be helpful!

Hi @Erik

Thanks for the super clear question and explanations.

The fact that the user is redirected to the 404 page suggests the link is referencing a page that does not exist. Maybe this is due to a redirection that’s missing.

Have you tried linking to www.[domainname].com/invite in the email instead of [domainname].com/invite?

Hi Joyce, that was helpful and I now have the invite going to the correct page, but for some reason it automatically redirects to login.

Here’s what’s happening

  1. User is invited via email
  2. Receives email with sign up link
  3. Link redirects them to [appname].so/invite/
  4. They immediately redirect to the login page (home page)

Any ideas how to prevent that from happening? Some notes on this:

  • the user is authenticated. I’ve added the UUID to the Invite page. You can navigate there after the redirect and see the new user’s uuid.
  • The invite page doesn’t require authentication, so anyone can reach it (try it here:
  • as above, if you link here directly, you don’t redirect to the login page.

Any ideas how to fix this?

I’ve temporarily solved this by adding a workflow to the login page that retrieves the current user and if they’re accepted the terms and conditions. If they haven’t, they’re routed to the change password page.

It’s only a temporary solution because:

  1. Users could received the link AND not accepted the T&Cs, then are routed to the change password page.
  2. I’m worried the change password process will require another fix. If users are always redirected to the Login page, I can’t send them to change password page, which requires an additional workflow…

I’ll keep this open since I wouldn’t consider this a solution. Would love to hear other ideas!

I’ve seen that this could be a problem of how SPAs manage this type of redirection from the Supabase invite template. Not sure what could be the solution, I’m having the same issue.