-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
refactor(api): Replaced OTP code from alphanumeric to numeric #230
Conversation
PR Description updated to latest commit (2eefd19) |
Hey @Ritika1705, thanks for making this PR! I will check this ASAP and try to merge it. |
PR Review 🔍
|
PR Code Suggestions ✨
|
Hey @Ritika1705 and @rajdip-b using |
@Ritika1705 hey! did you encounter any issue in the implementation? We are eager to merge your PR! |
Hi,
Got caught up with some work. Will try to finish it by eod. Thankyou
…On Mon, 20 May 2024 at 11:26 AM, Rajdip Bhattacharya < ***@***.***> wrote:
@Ritika1705 <https://github.com/Ritika1705> hey! did you encounter any
issue in the implementation? We are eager to merge your PR!
—
Reply to this email directly, view it on GitHub
<#230 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANAPAFWD2HHJCB2ZI5M5EV3ZDGGCJAVCNFSM6AAAAABH6FJGQCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJZG4ZDEMBZGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Oh! Alright no issues! Whenever you are free. |
For better secure code generation, we can follow this article: https://medium.com/getpowerplay/a-one-time-password-otp-generator-npm-library-based-on-nanoid-79821a173798 |
Hey @Ritika1705, I went through some articles, and I feel that we can use the already existing crypto.randomBytes(3).toString('hex'), I'm not sure how it will perform, but let's keep things simple - and use crypto package. |
Hi @rajdip-b , I have upadated the code to use crypto package. The code BigInt(\0x${crypto.randomUUID().replace(/-/g, '')}
|
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.
LGTM!
Quality Gate passedIssues Measures |
## [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
Replaced RandomUUid with Math.Random
Fixes #211
Dependencies
Mention any dependencies/packages used
Future Improvements
Mention any improvements to be done in future related to any file/feature
Mentions
Mention and tag the people
Screenshots of relevant screens
Add screenshots of relevant screens
Developer's checklist
If changes are made in the code:
Documentation Update
PR Type
enhancement
Description
auth.service.ts
to generate numeric codes usingMath.random()
instead of alphanumeric codes withrandomUUID()
.Changes walkthrough 📝
auth.service.ts
Change OTP Generation to Use Numeric Codes
apps/api/src/auth/service/auth.service.ts
randomUUID()
toMath.random()
.