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

Update backup code language to recovery code. #304

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions settings/src/components/account-status.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ export default function AccountStatus() {

const backupBodyText =
! backupCodesEnabled && ! hasPrimaryProvider
? 'Please enable a Two-Factor security key or app before enabling backup codes.'
? 'Please enable a Two-Factor security key or app before enabling recovery codes.'
: `You have
${ backupCodesEnabled ? '' : 'not' }
verified your backup codes for two-factor authentication.`;
verified your recovery codes for two-factor authentication.`;

return (
<div className={ 'wporg-2fa__account-status' }>
Expand Down Expand Up @@ -85,7 +85,7 @@ export default function AccountStatus() {
status={
! hasPrimaryProvider && ! backupCodesEnabled ? 'pending' : backupCodesEnabled
}
headerText="Two-Factor Backup Codes"
headerText="Two-Factor Recovery Codes"
bodyText={ backupBodyText }
disabled={ ! hasPrimaryProvider }
/>
Expand Down
14 changes: 7 additions & 7 deletions settings/src/components/backup-codes.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@
};

generateCodes();
}, [] );

Check warning on line 104 in settings/src/components/backup-codes.js

View workflow job for this annotation

GitHub Actions / All

React Hook useEffect has missing dependencies: 'setBackupCodesVerified', 'setError', and 'userRecord'. Either include them or remove the dependency array

// Finish the setup process.
const handleFinished = useCallback( async () => {

Check warning on line 107 in settings/src/components/backup-codes.js

View workflow job for this annotation

GitHub Actions / All

React Hook useCallback does nothing when called with only one argument. Did you forget to pass an array of dependencies?
// TODO: Add try catch here after https://github.com/WordPress/wporg-two-factor/pull/187/files is merged.
// The codes have already been saved to usermeta, see `generateCodes()` above.
setBackupCodesVerified( true );
Expand All @@ -117,7 +117,7 @@
<>
<div className="wporg-2fa__screen-intro">
<p>
Backup codes let you access your account if your primary two-factor
Recovery 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.
</p>
Expand All @@ -126,7 +126,7 @@

<Notice status="warning" isDismissible={ false }>
<Icon icon={ warning } className="wporg-2fa__print-codes-warning" />
Without access to the one-time password app or a backup code, you will lose
Without access to the one-time password app or a recovery code, you will lose
access to your account. Once you navigate away from this page, you will not be
be able to view these codes again.
</Notice>
Expand Down Expand Up @@ -181,7 +181,7 @@
<div className="wporg-2fa__backup-codes-list">
{ ! codes.length && (
<p>
Generating backup codes...
Generating recovery codes...
<Spinner />
</p>
) }
Expand Down Expand Up @@ -216,22 +216,22 @@
<>
<div className="wporg-2fa__screen-intro">
<p>
Backup codes let you access your account if your primary two-factor
Recovery 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.
</p>

{ backupCodesRemaining > 5 && (
<p>
You have <strong>{ backupCodesRemaining }</strong> backup codes remaining.
You have <strong>{ backupCodesRemaining }</strong> recovery codes remaining.
</p>
) }

{ backupCodesRemaining <= 5 && (
<Notice status="warning" isDismissible={ false }>
<Icon icon={ warning } />
<div>
You only have <strong>{ backupCodesRemaining }</strong> backup codes
You only have <strong>{ backupCodesRemaining }</strong> recovery codes
remaining. Please regenerate and save new ones before you run out. If
you don&apos;t, you won&apos;t be able to log into your account if you
lose your phone.
Expand All @@ -241,7 +241,7 @@
</div>

<Button isSecondary onClick={ () => setRegenerating( true ) }>
Generate new backup codes
Generate new recovery codes
</Button>
</>
);
Expand Down
2 changes: 1 addition & 1 deletion settings/src/components/download-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { useCallback } from '@wordpress/element';
import { Button } from '@wordpress/components';

export default function DownloadTxtButton( { codes, fileName = 'backup-codes.txt' } ) {
export default function DownloadTxtButton( { codes, fileName = 'recovery-codes.txt' } ) {
const downloadTxtFile = useCallback( () => {
const element = document.createElement( 'a' );
const file = new Blob( [ codes ], { type: 'text/plain' } );
Expand Down
Loading