fastn-stack / fastn

🚧 (Alpha stage software) fastn - better way to build websites 🚧
https://fastn.com
GNU Affero General Public License v3.0
468 stars 36 forks source link

Auth/reset password and some auth changes #1768

Closed siddhantk232 closed 8 months ago

siddhantk232 commented 8 months ago

This PR introduces a reset-password feature:

Auth changes

Refactor

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.

amitu commented 8 months ago

@siddhantk232 there are some conflicts, please resolve. We have switched to using .starttls_relay() (SMTP with StartTLS extension) as it seems neither AWS SES, nor postmark work with .relay() (SMTPS). Ideally we should make both protocol and port configurable.

siddhantk232 commented 8 months ago

There's a way to disable sending emails in dev mode (using FASTN_ENABLE_EMAIL) so we can live with .starttls_relay() for a short while. I'll later add more options for these in mail.rs