-
Notifications
You must be signed in to change notification settings - Fork 37
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
Auth/reset password and some auth changes #1768
Conversation
move all handled routes to auth/urls.rs
don't need it, we can get the same result in two handlers and fewer redirects
this id is required by request.ud()
@siddhantk232 there are some conflicts, please resolve. We have switched to using |
There's a way to disable sending emails in dev mode (using |
`/-/auth/create-account/` redirects to this route for sending email. users can also use this to request email again in case they did not receive it the first time
This PR introduces a reset-password feature:
/-/auth/set-password/
/-/auth/forgot-password/
. This sends an email with a link to set their password.Auth changes
/-/auth/create-account/
: requires two new json body params,password2
andaccept_terms
. See the integration tests to learn what has changes in request body./-/auth/create-account/
: redirect to/-/auth/resend-confirmation-email/
on successful requests. This same route can be used to re-request confirmation emails in cases where user does not receive email.FASTN_ENABLE_EMAIL
: new environment variable for use during development. This will be used to log emails to the console instead of actually sending it. This removes the need ofFASTN_SMTP*
environment variables.req_config.request.ud()
checks on server session before returning the user. This enables invalidation of logged in users on password reset.Refactor
Route
enum to keep track of auth related routes.What happens when a github user tried to reset their password?
The
/-/auth/set-password
, used when authenticated, converts their github oauth account to a normal email_password account. After doing this, they can use both the github login and the email_password login method.Same goes for
/-/auth/forgot-password/
, entering their github username/email will send an email with a link to set their password. Check https://github.com/siddhantk232/fastn-test-multiauth to test things out.