diff --git a/settings/src/components/backup-codes.js b/settings/src/components/backup-codes.js
index 1f560c1d..f6b6ddc8 100644
--- a/settings/src/components/backup-codes.js
+++ b/settings/src/components/backup-codes.js
@@ -24,10 +24,9 @@ import DownloadButton from './download-button';
*/
export default function BackupCodes( { onSuccess = () => {} } ) {
const {
- user: { backupCodesEnabled, hasPrimaryProvider, backupCodesRemaining },
- backupCodesVerified,
+ user: { hasPrimaryProvider },
} = useContext( GlobalContext );
- const [ regenerating, setRegenerating ] = useState( false );
+ const [ generating, setGenerating ] = useState( false );
// Prevent users from accessing directly through the URL.
if ( ! hasPrimaryProvider ) {
@@ -41,26 +40,21 @@ export default function BackupCodes( { onSuccess = () => {} } ) {
);
}
- if (
- ! backupCodesEnabled ||
- backupCodesRemaining === 0 ||
- regenerating ||
- ! backupCodesVerified
- ) {
- return
- Backup codes let you access your account if your primary two-factor - authentication method is unavailable, like if your phone is lost or stolen. Each - code can only be used once. -
+Please print the codes and keep them in a safe place.
@@ -142,12 +132,6 @@ function Setup( { setRegenerating, onSuccess } ) { <>
- Generating backup codes...
-
+
+ Backup codes let you access your account if your primary two-factor authentication method is + unavailable, like if your phone is lost or stolen. Each code can only be used once. +
+); + /** * Render the screen where users can manage Backup Codes. * * @param props - * @param props.setRegenerating + * @param props.setGenerating */ -function Manage( { setRegenerating } ) { +function Manage( { setGenerating } ) { const { - user: { backupCodesRemaining }, + user: { backupCodesEnabled, backupCodesRemaining }, } = useContext( GlobalContext ); return ( <>- Backup codes let you access your account if your primary two-factor - authentication method is unavailable, like if your phone is lost or stolen. Each - code can only be used once. -
+You have { backupCodesRemaining } backup codes remaining.
) } - { backupCodesRemaining <= 5 && ( + { backupCodesEnabled && backupCodesRemaining <= 5 && (