near / fast-auth-signer

https://fast-auth-signer.vercel.app
MIT License
29 stars 8 forks source link

Change auth flow if account does not exist during sign in #264

Open benmalcom opened 2 weeks ago

benmalcom commented 2 weeks ago

This PR changes the authentication flow when a user without an account tends to sign in, once we can't find the account of this user in the AuthCallbackPage, we show the CreateAccountForm and populate it with their intended details.

Follow this I extracted the create account process in to a form to be reused and performed some other related refactors.

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fast-auth-signer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 19, 2024 7:35pm
hcho112 commented 2 days ago

@benmalcom I just tried on this PR locally and it is working as expected. Only thing that I would like to see as improvement is that is it possible to directly create an account from below page to next instead of double verification on email?

image
benmalcom commented 2 days ago

@hcho112 if I get what you're saying, you think it will be okay to directly create an account since they're already coming to this page from their inbox which proves they own the email right?

hcho112 commented 2 days ago

@benmalcom yes! Initially I was little concern about this might expose email being used. However, I realise that in order to get to next step, they need to verify via given email first so we don't have to worry about security. If so, next thing came to my mind is UX there from user perspective, they already proven that they are the owner of the email, therefore we should allow them to create account without double verifying it

benmalcom commented 2 days ago

@esaminu what do you think?

benmalcom commented 1 day ago

Fixed

hcho112 commented 1 day ago

Also tests are failing, would it be to do with flaky? or actual failure?