Skip to content

add validation and transaction for user signup#1637

Merged
ErikaKK merged 12 commits into
masterfrom
1634-signup-behaviour-issue
Sep 3, 2025
Merged

add validation and transaction for user signup#1637
ErikaKK merged 12 commits into
masterfrom
1634-signup-behaviour-issue

Conversation

@ErikaKK

@ErikaKK ErikaKK commented Aug 17, 2025

Copy link
Copy Markdown
Contributor

Change Summary

[Briefly summarise the changes that you made. Just high-level stuff]

  • Solved by change the authentication method to OTP
image

Change Form

Fill this up (NA if not available). If a certain criteria is not met, can you please give a reason.

  • The pull request title has an issue number
  • The change works by "Smoke testing" or quick testing
  • The change has tests
  • The change has documentation

Other Information

[Is there anything in particular in the review that I should be aware of?]

@ErikaKK ErikaKK linked an issue Aug 17, 2025 that may be closed by this pull request
@vercel

vercel Bot commented Aug 17, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
website Ready Ready Preview Comment Sep 3, 2025 1:53pm

@ErikaKK ErikaKK changed the title add validation and transaction add validation and transaction for user signup Aug 17, 2025
@ErikaKK

ErikaKK commented Aug 18, 2025

Copy link
Copy Markdown
Contributor Author

Need to adjust a bit e: Unable to authenticate the request, you need to supply an active session

@SafetyInObscurity SafetyInObscurity self-assigned this Aug 22, 2025
@ErikaKK

ErikaKK commented Aug 29, 2025

Copy link
Copy Markdown
Contributor Author

I just had a look. It seems this is going to be a massive change definitely not ready for a PR yet.

@ErikaKK

ErikaKK commented Sep 1, 2025

Copy link
Copy Markdown
Contributor Author

TODO:

  1. add timer for the resend code
  2. go to the top after click next

@Julie-Salazar

Copy link
Copy Markdown

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).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the user leaves the page and then comes back? does the timer persist or reset?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean they close the page? They'll need to start the create-account process again

This comment was marked as outdated.

@ErikaKK ErikaKK requested review from Copilot and removed request for JeremiahPinto and SafetyInObscurity September 2, 2025 16:12

This comment was marked as outdated.

@ErikaKK ErikaKK requested a review from Copilot September 2, 2025 16:55

This comment was marked as outdated.

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/app/join/page.tsx
Comment thread src/app/join/page.tsx
Comment thread src/app/create-account/page.tsx
Comment thread src/app/create-account/page.tsx
@ErikaKK ErikaKK merged commit 8046b50 into master Sep 3, 2025
10 checks passed
@ErikaKK ErikaKK deleted the 1634-signup-behaviour-issue branch September 3, 2025 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Signup behaviour issue

4 participants