-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Consider providing different redirect pages for login and signup #2277
Comments
What I meant here was that I am not sure if having Wasp redirect user somewhere else upon their landing on login page if they are already logged in is ok, seemed possibly too aggressive, and I suggested we instead let them modify the LoginPage itself to handle this if needed. There are some connected issues here: #1772 and #402 . There is also the matter of login and signup hooks, and how they play into this. What we will likely want to do is take a holistic view at this, write down all the use cases / requirements, and then figure out the minimal feature set we can offer that will solve them all. As a very rough first try, requirements / use cases are:
And tools we have at our disposal are:
This might not be all, but I wanted to get the discussion started in this direction. @infomiho might have the most to say here. |
Agreed. People want to be able to redirect users when they first sign up. |
@Martinsos I think users are able to do almost everything already. Let me elaborate on how I would implement each bit:
Users are implementing the login page themselves. They render our
Users can redirect to a specific page that can decide where they want to redirect the user. The trick is to either use some sort of a field in the DB on the user that's called
This is something we need to add extra support for. We need to remember the page that was visited before we redirect to Basically, what I wanted to say: users own their login and signup pages and they have access to client side state / user object with some properties. It's possible to go quite far with the available tools i.e. |
Makes sense, but:
|
Wasp exposes the
onAuthSucceededRedirectTo
field that tels Wasp where to send the user after successful authentication (login and signup).Every now and then, users want different behavior depending on whether the user authenticated through login or through signing up.
For example (source):
Another example (source):
I believe users can currently (as of 0.14.2) do this by:
onAuthSucceededRedirectTo
.onAuthSucceededRedirectTo
page to perform custom logic, and updating its state through an action.But that's pretty ugly.
So, let's consider supporting different redirects based on the operation (login or signup).
@Martinsos Please elaborate on the idea you had here, I'm not what you meant: https://discord.com/channels/686873244791210014/1263461365872595054/1264940497961619527
The text was updated successfully, but these errors were encountered: