Skip to content
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

Show a notice on login when the user has no recovery codes recorded, is running low, or has logged in with a recovery code. #358

Closed
wants to merge 11 commits into from

Conversation

dd32
Copy link
Member

@dd32 dd32 commented Aug 16, 2024

See WordPress/wporg-two-factor#279

This PR shows the following notice when logging in with a recovery code, or is running low on recovery codes.

Login Running low Have no recovery codes
Screenshot 2024-08-16 at 1 11 30 PM Screenshot 2024-08-16 at 1 13 30 PM Screenshot 2024-08-16 at 1 14 23 PM

In the first case, the I'll do this later only shows if the user has at least one more recovery code on the account. I'm not against removing the bypass link entirely though.

I realise that the 2nd and 3rd have a bad orphan, I need some text inspiration :)

! $used_recovery_code &&
(
// They have ample codes available..
$codes_available > 3 ||
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$codes_available > 3 ||
$codes_available > 5 ||

This should be 5 to match the 2FA interface.

https://github.com/WordPress/wporg-two-factor/blob/4a154cc6a7e37a5acc28d467cff327cd80712e88/settings/src/components/backup-codes.js#L230

Copy link
Member Author

@dd32 dd32 Aug 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm tempted to leave this at 3 despite the settings UI switching to a warning at 5, it makes sense that we'd nag on login later than we'd nag at them just casually browsing the settings UI.

Mind you, having used more than 50% of your codes is probably a sign you use them fairly often..

@StevenDufresne
Copy link
Contributor

This looks good. Our interfaces uses "Backup Codes" as opposed to "Recovery codes". We should remain consistent.

Co-authored-by: Steven Dufresne <steve.dufresne@automattic.com>
@dd32
Copy link
Member Author

dd32 commented Aug 16, 2024

Our interfaces uses "Backup Codes" as opposed to "Recovery codes". We should remain consistent.

I was thinking the same thing. We should probably standardise on Recovery Codes, as that's what we show on the Login page after the upstream rename WordPress/two-factor#521

Co-authored-by: Steven Dufresne <steve.dufresne@automattic.com>
bazza pushed a commit that referenced this pull request Aug 20, 2024
…ne are saved or the user is running really low on them.

This will hopefully reduce the number of users who become locked out of their account after losing their authentication key / device / etc.

Merges #358
Fixes WordPress/wporg-two-factor#279
See WordPress/wporg-two-factor#300, WordPress/wporg-two-factor#275


git-svn-id: https://meta.svn.wordpress.org/sites/trunk@13982 74240141-8908-4e6f-9713-ba540dce6ec7
@dd32 dd32 closed this Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants