Learning about the Site URL and redirect URLs
I’ll finish this chapter by explaining to you the very important, but very easy-to-digest, information about the URL configurations in Supabase. I’ll cover what they are, why they are important, and where to change them.
Previously, in our short trip to signInWithOtp
, I showed the following code snippet:
supabase.auth.signInWithOtp({ email, options: { emailRedirectTo: "http://localhost:3000/tickets", }, });
The emailRedirectTo
value contains the URL that you want the Auth Service to redirect the user to after validating a token from the magic link. Although we didn’t use any emailRedirectTo
value in our first implementation with signInWithOtp
, it still redirected us to http://localhost:3000/
.
However, that wasn’t because the Supabase client knew where our application runs. It was a happy coincidence that this is the default value...