Authentication system development#2
Merged
Conversation
- Implemented middleware to handle public and private routes based on authentication token. - Redirect users to home if they have a token and access public paths. - Redirect users to login if they attempt to access private paths without a token. - Added configuration for middleware matching specific routes. test: add unit tests for middleware functionality - Created comprehensive tests for public and private paths. - Included edge case tests for empty paths and undefined tokens. - Utilized mock requests to simulate different scenarios for middleware behavior. chore: update package.json dependencies - Added jest and ts-jest for testing. - Updated @types/node to a more specific version.
- Removed mongoose version from dependencies and updated to 8.15.1 in devDependencies. - Added Babel configuration for transpiling. - Created user model with schema validation for username, email, and password. - Implemented tests for user model properties and validation rules. - Updated middleware to handle public and private routes based on token presence. - Added documentation for testing with Jest.
- Implemented `getTokenData` function to extract and verify JWT from cookies. - Created `dbConfig.ts` for MongoDB connection handling. - Developed `mailer.ts` to send verification and password reset emails using nodemailer. - Updated user model to correctly reference the collection name. - Added tests for user model and mailer functionality, ensuring proper behavior and error handling. - Updated package dependencies for better type support and compatibility.
…avbar for verification status
…babel configuration for jest
…ith validation and UI enhancements
Login page frontend
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.