🔏 fix: Enhance Two-Factor Authentication #6247
Merged
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.
Summary
This pull request includes significant changes to the two-factor authentication (2FA) implementation, as well as some updates to the
data-schemas
package. The most important changes involve adding atwoFactorEnabled
field to the user model, updating related controllers and components, and licensing updates.Improvements to 2FA implementation:
api/server/controllers/TwoFactorController.js
: AddedtwoFactorEnabled
field to user updates and included checks to ensure 2FA is enabled or disabled appropriately. [1] [2] [3] [4]api/server/controllers/auth/LoginController.js
: Updated login logic to check fortwoFactorEnabled
instead of backup codes.api/server/controllers/auth/TwoFactorAuthController.js
: Modified to ensure 2FA is enabled and to handle thetwoFactorEnabled
field.client/src/components/Nav/SettingsTabs/Account/TwoFactorAuthentication.tsx
: Updated various parts of the 2FA setup and disable phases to check fortwoFactorEnabled
instead of backup codes. [1] [2] [3] [4] [5] [6] [7]Updates to
data-schemas
package:packages/data-schemas/LICENSE
: Added MIT License.packages/data-schemas/README.md
: Added a comprehensive README for thedata-schemas
package.packages/data-schemas/package.json
: Updated version to0.0.2
and changed license to MIT. [1] [2]packages/data-schemas/src/schema/user.ts
: AddedtwoFactorEnabled
field to the user schema.packages/data-provider/src/types.ts
: AddedtwoFactorEnabled
field toTUser
type.Change Type
Testing
Please describe your test process and include instructions so that we can reproduce your test. If there are any important variables for your testing configuration, list them here.
Test Configuration:
Checklist