-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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: Two-Factor Authentication with Backup Codes & QR support #5685
Conversation
![]() |
…pport (#5684) * working version for generating TOTP and authenticate. * better looking UI * refactored + better TOTP logic * fixed issue with UI * fixed issue: remove initial setup when closing window before completion. * added: onKeyDown for verify and disable * refactored some code and cleaned it up a bit. * refactored some code and cleaned it up a bit. * refactored some code and cleaned it up a bit. * refactored some code and cleaned it up a bit. * fixed issue after updating to new main branch * updated example
9a7f854
to
20dfbd4
Compare
- (optional) maybe show the user which backup codes have already been used?
@berry-13 it’s now your turn to do your magic. After Berry is done with the UI it’s ready for Merge. |
@danny-avila conflicts has been resolved. is ready! |
Please see my review comments and unmark as draft when complete. Thank you for your work on this, excited to use it. |
…TOTP secret query
api/models/schema/userSchema.js
Outdated
}, | ||
backupCodes: { | ||
type: [backupCodeSchema], | ||
default: [], |
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.
can we remove the default?
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.
no we can not. this is used to check if the user has backupCodes or not. I'm sorry. it's part of the login controller logic as well
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.
It can be removed, I'll do it
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 know I wrote it to you 😀. Thank you.
… from path mapping
…FactorControllers test files
… for two-factor authentication
api/models/schema/userSchema.js
Outdated
}, | ||
backupCodes: { | ||
type: [backupCodeSchema], | ||
default: [], |
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.
It can be removed, I'll do it
…er, LoginController, and jwtStrategy
…e default array in user schema
…or handling and loading state management, prevent redirect to /login
Summary
Closes: #5681
This PR introduces two-factor authentication (2FA) functionality to the application. The changes include:
Backend Enhancements:
totpEnabled
,totpSecret
, andbackupCodes
.Frontend Enhancements:
General:
passport-totp
) and adjusted API endpoints accordingly.✅ Status: Ready for review.
Change Type
Testing
///
Checklist