saasykits / next-lucia-auth

This is a Next.js T3 project with authentication implemented using Lucia.
https://next-lucia.vercel.app
MIT License
350 stars 36 forks source link

Redirect too fast for form to handle. (Register page) #44

Closed Fr3akyMurk closed 4 months ago

Fr3akyMurk commented 4 months ago

Describe the bug The form gets redirected as soon as possible (100ms that i saw) (This was code for the editor, not sign in.) which is way too soon for the db to even get a request and thus you get redirected without your account being created. This seems to only affect users like me who do not use planetscale but for best practices it could be a great idea to implement a more stable fix.

To Reproduce

Expected behavior An account being created before you get redirected, or alternatively sign the user in immediately after creating the account.

Screenshots Not applicable, a video would be more suitable for this type of issue.

Fr3akyMurk commented 4 months ago

46 PR opened.

Fr3akyMurk commented 4 months ago

Surprisingly, login page does not do this, only the signup page.

iamtouha commented 4 months ago

This occurred because the link component wraps the button and the button submits the form when clicked.