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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/User email verification #1874
Feat/User email verification #1874
Changes from all commits
0c4082d
d8897fa
a7b30f6
a006f8a
c432106
f649763
f047276
4b5a37d
7708ba1
105550a
ae87169
ddaef95
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add index cleanup to down migration.
If implementing the suggested index in the up migration, ensure it's properly cleaned up in the down migration.
Apply this diff to include index cleanup:
public async down(queryRunner: QueryRunner): Promise<void> { queryRunner.query(` + DROP INDEX IF EXISTS "IDX_USER_EMAIL_VERIFICATION_CODE"; ALTER TABLE "user" DROP COLUMN IF EXISTS "emailVerificationCode", DROP COLUMN IF EXISTS "isEmailVerified"; `); }
📝 Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security: Avoid logging sensitive information
The debug logging includes the full params object which contains the email address. This could expose sensitive PII in logs.
Consider:
🛠️ Refactor suggestion
Add input validation
The method should validate the email parameter to ensure it's not undefined or empty.
Apply this diff to add validation:
📝 Committable suggestion
Fix interface compliance: Add missing
user
parameterThe method signature doesn't match the
NotificationAdapterInterface
. According to the AI summary, the interface requires bothemail
anduser
properties in the params object.Apply this diff to align with the interface:
💡 Codebase verification
Implementation mismatch detected between interface and mock adapter
The mock adapter implementation doesn't match the interface definition:
sendUserEmailConfirmationCodeFlow(params: { email: string; user: User }): Promise<void>
sendUserEmailConfirmationCodeFlow(params: { email: string }): Promise<void>
The mock adapter is missing the required
user
parameter in its implementation, while the resolver is correctly passing both parameters. This needs to be fixed to maintain consistency with the interface contract.🔗 Analysis chain
Verify implementation consistency
Let's verify the interface definition and usage across the codebase.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 6007
Script:
Length of output: 1345
Script:
Length of output: 14412
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
MockNotificationAdapter needs to be updated to match the interface
The
MockNotificationAdapter
implementation ofsendUserEmailConfirmationCodeFlow
doesn't match the interface definition. The interface requires bothemail
anduser
parameters, but the mock implementation only acceptsemail
.src/adapters/notifications/MockNotificationAdapter.ts
: Update the method signature tosendUserEmailConfirmationCodeFlow(params: { email: string; user: User }): Promise<void>
🔗 Analysis chain
LGTM! Well-structured enum addition.
The new notification event name follows the established naming convention and clearly describes its purpose within the email verification flow.
Let's verify the usage of this new enum value in the notification adapters:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 816
Script:
Length of output: 1397
Script:
Length of output: 8501
Script:
Length of output: 3415