Skip to content

Authentication system development#2

Merged
deltathecreatorr merged 12 commits into
devfrom
authentication_system_development
Jul 3, 2025
Merged

Authentication system development#2
deltathecreatorr merged 12 commits into
devfrom
authentication_system_development

Conversation

@deltathecreatorr
Copy link
Copy Markdown
Owner

No description provided.

Not-5Delta and others added 12 commits May 24, 2025 23:01
- 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.
@deltathecreatorr deltathecreatorr merged commit 9e9c2ab into dev Jul 3, 2025
1 check failed
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.

2 participants