-
-
Notifications
You must be signed in to change notification settings - Fork 116
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(api): Added support for changing email of users #233
feat(api): Added support for changing email of users #233
Conversation
PR Description updated to latest commit (424505a) |
PR Review 🔍
|
PR Code Suggestions ✨
|
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.
As per the discussions in Discord thread, you would need to make a slight addition to this PR: you would need to change the user's auth provider to EMAIL_OTP
if they successfully change their email.
424505a
to
adc623a
Compare
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.
You would need to update your branch with #230, where the method of generating otp has changed.
apps/api/src/prisma/migrations/20240520173306_alter_user_email_change/migration.sql
Outdated
Show resolved
Hide resolved
rebase commit
…rime/keyshade into 222-user-email-change
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #233 +/- ##
============================================
+ Coverage 62.20% 91.71% +29.50%
============================================
Files 76 111 +35
Lines 1503 2510 +1007
Branches 260 469 +209
============================================
+ Hits 935 2302 +1367
+ Misses 568 208 -360
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
I think the code looks perfect! You just missed out creating the tests for the code you wrote. Codecov points to the lines in red that are currently not covered by the tests.
Ahh okay. I'll get to the tests sometime in the evening. Just to be clear only the tests for the lines in the above two files as shown by Codecov is fine right ? |
Yeap! Just write the tests for |
Quality Gate passedIssues Measures |
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.
Awesome work man!
## [1.4.0](v1.3.0...v1.4.0) (2024-05-24) ### 🚀 Features * add example for health and email auth ([b834d25](b834d25)) * **api:** Add `minio-client` provider ([#237](#237)) ([cd71c5a](cd71c5a)) * **api:** Add feature to fork projects ([#239](#239)) ([3bab653](3bab653)) * **api:** Added feedback form module ([#210](#210)) ([ae1efd8](ae1efd8)) * **api:** Added Project Level Access ([#221](#221)) ([564f5ed](564f5ed)) * **api:** Added support for changing email of users ([#233](#233)) ([5ea9a10](5ea9a10)) * implemented auth, ui for most, and fixed cors ([#217](#217)) ([feace86](feace86)) * **platfrom:** add delete method in api client ([#225](#225)) ([55cf09f](55cf09f)) * **postman:** add example for get_self and update_self ([e015acf](e015acf)) * **web:** Add and link privacy and tnc page ([#226](#226)) ([ec81eb9](ec81eb9)) ### 🐛 Bug Fixes * **web:** docker next config not found ([#228](#228)) ([afe3160](afe3160)) ### 📚 Documentation * Added docs regarding postman, and refactored architecture diagrams ([f1c9777](f1c9777)) * Fix typo in organization-of-code.md ([#234](#234)) ([11244a2](11244a2)) ### 🔧 Miscellaneous Chores * **api:** Get feedback forward email from process.env ([#236](#236)) ([204c9d1](204c9d1)) * **postman:** Initialized postman ([bb76384](bb76384)) * **release:** Update changelog config ([af91283](af91283)) * Remove swagger docs ([#220](#220)) ([7640299](7640299)) ### 🔨 Code Refactoring * **api:** Replaced OTP code from alphanumeric to numeric ([#230](#230)) ([f16162a](f16162a))
🎉 This PR is included in version 1.4.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
User description
Description
Give a summary of the change that you have made
Fixes #222
Dependencies
NA
Future Improvements
NA
Mentions
Screenshots of relevant screens
Developer's checklist
If changes are made in the code:
Documentation Update
PR Type
Enhancement, Tests
Description
UserController
.UserService
.UserEmailChange
table and defined its schema in Prisma.Changes walkthrough 📝
user.controller.ts
Add OTP validation and resending endpoints in UserController
apps/api/src/user/controller/user.controller.ts
validateOtp
andresendOtp
methods.user.service.ts
Implement OTP logic and email change handling in UserService
apps/api/src/user/service/user.service.ts
validateOtp
andresendOtp
methods.migration.sql
Create UserEmailChange table and add unique index
apps/api/src/prisma/migrations/20240519122223_add_user_email_change/migration.sql
UserEmailChange
table.userId
.schema.prisma
Define UserEmailChange model in Prisma schema
apps/api/src/prisma/schema.prisma
UserEmailChange
model.userId
,newEmail
,otp
, andcreatedOn
.user.e2e.spec.ts
Add end-to-end tests for email change OTP functionality
apps/api/src/user/user.e2e.spec.ts