Update local backup OS auth strings

Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com>
This commit is contained in:
automated-signal
2026-03-31 13:25:10 -05:00
committed by GitHub
parent 5c5ce4aed1
commit 96d4a2acdd
5 changed files with 12 additions and 43 deletions
-8
View File
@@ -8554,14 +8554,6 @@
"messageformat": "This action could not be completed because system authentication failed. Please try again or open the Signal app on your mobile device and go to Backup Settings to view your recovery key.",
"description": "Error shown in local backups settings when system authentication fails while trying to view the recovery key."
},
"icu:Preferences__local-backups-auth-error--unauthorized-no-windows-ucv": {
"messageformat": "This action could not be completed because Windows Hello is not enabled on your computer. Please set up Windows Hello and try again, or open the Signal app on your mobile device and go to Backup Settings to view your recovery key.",
"description": "Error shown in local backups settings on Windows when Windows Hello is not available while trying to view the recovery key."
},
"icu:Preferences__local-backups-auth-error--unavailable": {
"messageformat": "The action could not be completed because authentication is not available on this computer. Please open the Signal app on your mobile device and go to Backup Settings to view your recovery key.",
"description": "Error shown in local backups settings when system authentication is unavailable while trying to view the recovery key."
},
"icu:Preferences__view-key": {
"messageformat": "View key",
"description": "Button to view the backup key which is used to restore a message history backup"
+5 -4
View File
@@ -290,18 +290,19 @@ export function PreferencesBackups({
size="lg"
disabled={isAuthPending}
onClick={async () => {
if (!isLocalBackupsSetup) {
if (isLocalBackupsSetup) {
setSettingsLocation({ page: SettingsPage.LocalBackups });
} else {
try {
setIsAuthPending(true);
const result = await promptOSAuth('enable-backups');
if (result !== 'success' && result !== 'unsupported') {
return;
if (result === 'success' || result === 'unsupported') {
setSettingsLocation({ page: SettingsPage.LocalBackups });
}
} finally {
setIsAuthPending(false);
}
}
setSettingsLocation({ page: SettingsPage.LocalBackups });
}}
>
{isLocalBackupsSetup
+6 -24
View File
@@ -85,7 +85,9 @@ export function PreferencesLocalBackups({
startLocalBackupExport: () => void;
}): React.JSX.Element | null {
const [authError, setAuthError] =
React.useState<Omit<PromptOSAuthResultType, 'success'>>();
React.useState<
Exclude<PromptOSAuthResultType, 'success' | 'unsupported'>
>();
const [isAuthPending, setIsAuthPending] = useState<boolean>(false);
const [isDisablePending, setIsDisablePending] = useState<boolean>(false);
const [isShowingBackupKeyChangedModal, setIsShowingBackupKeyChangedModal] =
@@ -336,7 +338,9 @@ export function PreferencesLocalBackups({
<AxoAlertDialog.Content escape="cancel-is-noop">
<AxoAlertDialog.Body>
<AxoAlertDialog.Description>
{getOSAuthErrorString(i18n, authError) ?? i18n('icu:error')}
{i18n(
'icu:Preferences__local-backups-auth-error--unauthorized'
)}
</AxoAlertDialog.Description>
</AxoAlertDialog.Body>
<AxoAlertDialog.Footer>
@@ -772,28 +776,6 @@ function LocalBackupsBackupKeyTextarea({
);
}
function getOSAuthErrorString(
i18n: LocalizerType,
authError: Omit<PromptOSAuthResultType, 'success'> | undefined
): string | undefined {
if (!authError) {
return undefined;
}
// TODO: DESKTOP-8895
if (authError === 'unauthorized') {
return i18n('icu:Preferences__local-backups-auth-error--unauthorized');
}
if (authError === 'unauthorized-no-windows-ucv') {
return i18n(
'icu:Preferences__local-backups-auth-error--unauthorized-no-windows-ucv'
);
}
return i18n('icu:Preferences__local-backups-auth-error--unavailable');
}
function LocalBackupSetupIcon(props: { symbol: 'key' | 'lock' }): JSX.Element {
return (
<div
-1
View File
@@ -352,7 +352,6 @@ export function verifyWithOSForExport(
case 'success':
chooseExportLocation()(dispatch, getState, null);
break;
case 'unauthorized-no-windows-ucv':
case 'unsupported':
case 'error':
log.warn(
+1 -6
View File
@@ -24,7 +24,6 @@ export type PromptOSAuthResultType =
| 'error'
| 'success'
| 'unauthorized'
| 'unauthorized-no-windows-ucv'
| 'unsupported';
/**
@@ -32,9 +31,6 @@ export type PromptOSAuthResultType =
* before viewing sensitive account credentials.
* Return values: 'success' indicates successful authentication.
* 'unauthorized' indicates authentication is possible, but failed or was canceled.
* 'unauthorized-no-windows-ucv' indicates the Windows API was not available or not setup.
* Because this is the default case on Windows without Windows Hello enabled,
* this response should be treated as an auth failure, and not bypassed.
* 'unsupported' indicates the OS is not supported. Authentication can be skipped
* or user asked to use a fallback method (e.g. using the primary mobile device).
*/
@@ -75,11 +71,10 @@ async function promptOSAuthWindows(
text: string
): Promise<PromptOSAuthResultType> {
// For Windows a verification device is required for the UserConsentVerifier API.
// If unavailable, then the UI must fail and require the user to setup verification.
const availability = await checkAvailabilityWindowsUcv();
log.info(`Windows UCV availability=${availability}`);
if (availability !== 'available') {
return 'unauthorized-no-windows-ucv';
return 'unsupported';
}
const result = await requestVerificationWindowsUcv(text);