user can now verify email with code on 2fa using alternate context when creating an account #229
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request implements email verification as part of the signup flow, enhances backend and frontend logic to support this, and introduces protected dashboard routes that require both authentication and verified email. The changes include backend support for email verification templates, improved user data handling, and frontend updates for signup, verification, and dashboard access.
Backend changes for email verification:
signupVerificationtemplates and related data mapping). [1] [2] [3] [4] [5]EmailService.sendVerificationCodeto use the new template manager for rendering email verification messages.User data enhancements:
isEmailVerifiedin user objects returned by login, registration, and profile endpoints to allow the frontend to check email verification status. [1] [2] [3]Frontend signup and verification flow:
SignupFormto redirect users to a two-factor authentication (2FA) page for email verification after registration, storing relevant data in sessionStorage.TwoFactorAuthto handle both password reset and signup verification flows, including verifying email, updating tokens, fetching user data, and redirecting to the appropriate dashboard. [1] [2] [3] [4] [5] [6]EmailVerificationSuccesscomponent to display a confirmation screen and redirect users to their dashboard after successful email verification.Protected dashboard routes:
ProtectedRoutecomponent to restrict access to dashboard routes, requiring both authentication and verified email status. Updated dashboard routes inApp.tsxto use this protection. [1] [2] [3] [4]