-
-
Notifications
You must be signed in to change notification settings - Fork 25
Enforce one-time viewing of 2FA recovery codes #45
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: mortenebak <[email protected]>
Co-authored-by: mortenebak <[email protected]>
|
@copilot FAILED Tests\Feature\Settings\TwoFactorTest > recovery co… ViewException |
Co-authored-by: mortenebak <[email protected]>
Fixed in e10d083. Added |
…end of migration file
✅ Completed: 2FA Recovery Codes Security Enhancement
Changes Implemented
two_factor_recovery_codes_viewed_atcolumn to users tableconfirmTwoFactorAuthentication()to set the viewed timestamp when showing codes for the first timeshowRecoveryCodes()method to prevent showing codes if they have been viewedregenerateRecoveryCodes()to reset the viewed timestamp so new codes can be shown oncehasViewedRecoveryCodes()helper methodRecent Fix
Added
hasViewedRecoveryCodes()helper method to User model to safely check if recovery codes have been viewed, preventing attribute access errors in blade views during testing.Security Improvement
Recovery codes are now only displayed once when first generated:
showRecoveryCodes()after viewing shows an error messageTesting
Added 3 new test cases:
All existing tests updated to account for the new timestamp field.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.