-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Login/Magic link email redirection argument/url #62
Comments
hey @laurentS this is a great suggestion, transferring this to the auth server repo to track it there 👍 |
Related on Netlify's GoTrue:
Possible fix: netlify/gotrue#149
So it seems that we can add |
we just need to test that it works with our slightly altered flow: In netlify emails work like:
In supabase:
|
I tested and it does indeed get passed all the way through lets add the ability to set the referrer header ("callback_url") on the signIn() method. we also need to decide whether to blank out referrer if the user doesn't explicitly set it -> since it can result in unpredictable behavior as per supabase/supabase#640 (or we can document this up, as the desired behavior?) |
need to an additional query param to the email links referrer, that will inform the |
@awalias I think you can do it one of 2 ways:
I was initially thinking of the latter, but I can't really think of any strong argument in favour of either. |
Thanks for this @laurentS - here is what we are thinking, note that this flow is if "Email Confirmations" are turned on and I think you've scoped out a flow without the Email Confirmations
const { user } = supabase.auth.signUp({
email: 'user@email.com`
redirectTo: 'https://some-custom-url.com/after-signup'
}) With the new
Since we need to preserve the
After the user confirms their address then the |
I was thinking of a flow with email confirmation, but you've done a much better job of explaining it than I did. |
@kiwicopple can you expand on whether or not this will also apply to other login methods such as social? |
Confirmed - we will add this to all functionality (including password resets, magic links, etc) |
🎉 This issue has been resolved in version 1.4.8 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Glad to see this fix! Is this currently usable? I tried: |
I am also having problems setting It strips away the /#/. @kiwicopple is this expected? Edit: Added an issue: #90 |
I can see that this broadly works for the Site Url but it does not seem to work for the additional redirect urls. I want to have a variable in the redirect, so it is not possible to provide a exact url In other words, I have success with
|
Feature request
Is your feature request related to a problem? Please describe.
Right now, when getting a magic link or signup confirmation email, the link always sends the user to the site URL defined in the settings page. While this is great, I would like to be able to direct users to different parts of the app depending on where they are when login in/signing up.
Describe the solution you'd like
I can think of several ways of doing this.
redirect_to
field in theauth.users
table, set it when I trigger the magic link/signup email and read it on the other side to send the user to the right place. This means 2 db writes per login/signup (one before, one after to clear the field) and seems a bit heavy and brittle (what if there is an error just after the field is cleared? the link in the email will not work anymore)redirectTo
parameter in theauth.signUp
(or magic link) call, which would be passed on to the link in the email, and finally back to the page the user lands on (the site URL), so that the app can process this. so my siteURL could look likeexample.com/auth/postLogin?redirectTo=<theNextStep>
Describe alternatives you've considered
See above, I think the second option is much nicer and easier to manage (at least from my perspective 😉 )
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: