add validation and transaction for user signup#1637
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Need to adjust a bit |
|
I just had a look. It seems this is going to be a massive change definitely not ready for a PR yet. |
|
TODO:
|
|
I might have missed it somewhere where we discussed to change, but i think this is much more secure than just the email verification process and helps people from messing up the process if they open things in diff browsers or diff windows (sometimes this was an issue). |
There was a problem hiding this comment.
What happens if the user leaves the page and then comes back? does the timer persist or reset?
There was a problem hiding this comment.
Do you mean they close the page? They'll need to start the create-account process again
There was a problem hiding this comment.
Pull Request Overview
This PR switches authentication from email links to OTP (one-time password) codes for user signup and login flows.
- Replaces email link authentication with OTP-based email verification
- Updates Clerk user creation to store user metadata in unsafeMetadata instead of firstName/lastName fields
- Adds middleware redirect to prevent authenticated users from accessing auth pages
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/server/api/routers/admin/users/create-manual.ts | Updates user creation to use full name as firstName and store additional data in unsafeMetadata |
| src/middleware.ts | Adds redirect logic for authenticated users accessing auth pages |
| src/app/join/page.tsx | Converts login flow from email links to OTP verification with step-based UI |
| src/app/create-account/page.tsx | Converts signup flow from email links to OTP verification with step-based UI |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Change Summary
[Briefly summarise the changes that you made. Just high-level stuff]
Change Form
Fill this up (NA if not available). If a certain criteria is not met, can you please give a reason.
Other Information
[Is there anything in particular in the review that I should be aware of?]