Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User Registration Page #32

Open
9 tasks
kavinphan opened this issue Feb 4, 2025 · 0 comments
Open
9 tasks

User Registration Page #32

kavinphan opened this issue Feb 4, 2025 · 0 comments
Assignees
Labels

Comments

@kavinphan
Copy link
Contributor

kavinphan commented Feb 4, 2025

Description

Create the user registration page (at /register) to match the design.

Note that this flow is a bit complex:

  • (not in ticket) user clicks on the invite link from the invitation email and is redirected to /register?token=${TOKEN}
  • If token is not provided, redirect to /
  • Fetch invite from /api/invites/[token]
  • If 400 response, display error message "Invalid or expired invite"
  • Show registration form (email and name should be returned from the response and pre-filled in the form)
  • POST to /api/users with inviteToken and password form data
    • The /api/users route handler was created here

For displaying static error messages like "Invalid or expired invite", I would opt for using a simple p tag.
For displaying dynamic error messages that result from user actions (like password confirmation), I would react-hot-toast (which is already in the project).

Success Criteria

  • If token query param is not provided, redirect to /
  • If 400 response, display "Invalid or expired invite"
  • The email and name fields are pre-filled with the results of the fetch request to /api/invites/[token]
  • If the passwords do not match, an error appears
  • Form is submitted to /api/users
  • On success, sign the user in and redirect to /
  • The user registration form matches the design
  • The user registration form shows the correct fields relative to the selected user type
  • The user registration form is functional at all dimension presets from Laptop and up
@kavinphan kavinphan changed the title User Registration Form User Registration Page Feb 4, 2025
@kavinphan kavinphan added this to the admin account management milestone Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants