Auth Routes Broken Into Controller Files #223
Merged
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 introduces a comprehensive set of authentication controllers for the backend, implementing all major endpoints needed for user registration, login, password management, email verification, and admin invitations. The controllers handle user validation, security checks, token management, and email communications, providing a robust authentication system.
The most important changes are:
Authentication Endpoints Implementation:
register,login,logout,refresh, andrefreshTokencontrollers to handle user registration, authentication, session management, and JWT token refresh logic. These controllers include input validation, password hashing, account status checks, and refresh token storage/revocation. [1] [2] [3] [4]Password Reset & Verification Flows:
Implemented
forgotPassword,resetPassword,verifyResetCode, andverifyPasswordResetCodecontrollers to support secure password reset workflows, including code generation, validation, and password updating with checks against password reuse. [1] [2]Added
verifyEmailandresendVerificationcontrollers to handle user email verification via 6-digit codes, including resending codes and marking emails as verified. [1] [2]User Profile & Role Management:
Added
mecontroller to allow authenticated users to retrieve their own profile information securely, excluding sensitive fields.Implemented
invitecontroller to allow admins to create invite codes for new admin or interviewer account registration, supporting role-based access and invite expiration.Controller Organization:
index.tsto centralize and simplify imports of all authentication controllers.