Open
Conversation
… eslint, db repo, etc.
…emented server side and client side (not fully tested yet)
…h srp. registration complete
… as configuring the user, auth session, and token db collections
…ldve but wasnt before
There was a problem hiding this comment.
Pull Request Overview
This PR introduces significant refactoring and enhancement across the authentication and authorization modules of the marketing website API. Key changes include the addition of new MFA and token schemas and services, middleware improvements for authentication and request parsing, and adjustments in the household controller to enforce consistent type handling.
Reviewed Changes
Copilot reviewed 57 out of 59 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| api/src/services/auth/mfa.ts | Adds MFA service functionality for key generation and verification. |
| api/src/schemas/obj-id.ts | Updates object ID schemas to support union types and transformation. |
| api/src/schemas/auth/user.ts | Refactors user and email schemas and error handling for user validation. |
| api/src/schemas/auth/tokens.ts | Adds new token types and updates token payload schemas for MFA. |
| api/src/schemas/auth/auth.ts | Introduces consolidated authentication schemas and middleware helpers. |
| api/src/routes/auth.ts | Updates auth routes with new endpoints and middleware usage. |
| api/src/middleware/auth.ts | Implements improved middleware for authentication and auto token refresh. |
| api/src/controllers/household.ts | Adjusts user ID handling consistently by converting to string. |
| api/src/index.ts | Registers new middleware and initializes database blacklists. |
| api/src/generate-jwe-encryption-key.ts | Adds a script for generating a 256-bit key for JWE encryption. |
| api/src/configure-db.ts | Introduces a DB configuration script for collections. |
| api/README.md | Updates documentation to include MFA token expiry details. |
Files not reviewed (2)
- api/package-lock.json: Language not supported
- api/package.json: Language not supported
Comments suppressed due to low confidence (1)
api/src/schemas/auth/auth.ts:34
- [nitpick] There is a typo in 'bigIntTransormed'; consider renaming it to 'bigIntTransformed' for clarity.
const bigIntTransormed = z
| /** The user's sex/gender */ | ||
| export type Sex = z.infer<typeof sexSchema>; | ||
|
|
||
| /** THe user schema */ |
There was a problem hiding this comment.
Fix the capitalization error: 'THe' should be 'The'.
Suggested change
| /** THe user schema */ | |
| /** The user schema */ |
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.