Reputation: 11
I'm building a course on Supabase for my students. In the course they work in different chapters (nested folders) in a GitHub repo which they can upload on a server or test locally.
There will be a chapter (folder) for magiclink-signup and one for password-signup.
The problem is, the URL in the confirm-signup-email always redirects to the root (e.g. https://studentserver.com
) of the server instead of https://studentserver.ch/03\_supabase\_authentication/1\_magiclink.html
. On the root, authentication obviously fails.
I defined the redirect URL in the Supabase dashboard to my nested folder: https://studentserver.ch/03\_supabase\_authentication/1\_magiclink.html
And I also set the redirect-url programmatically to window.location.href
:
const supa = supabase.createClient(supabaseUrl, supabaseKey, {
auth: {
redirectTo: window.location.href,
},
});
What am I doing wrong?
Upvotes: 0
Views: 619
Reputation: 18680
What you have set as the redirect URL and what is passed to the redirectTo
option in your sign up code has to match exactly. No extra slashes or anything are allowed. If you use window.location.href
, it might include some slashes or extra query parameters. Because of this, it's probably better to hard code it.
Also, using underscores in your URL could cause some unwanted issues. I would rename your html
file with hyphens instead of underscores.
Upvotes: 0