feat: recovery phrase to recovery password

pull/3056/head
William Grant 1 year ago
parent 9a756a8c9b
commit 68f8d12aa5

@ -191,7 +191,7 @@
"enterNewLineDescription": "SHIFT + ENTER sends a message, ENTER starts a new line",
"enterNewPassword": "Please enter your new password",
"enterPassword": "Please enter your password",
"enterRecoveryPhrase": "Enter your recovery phrase",
"recoveryPasswordEnter": "Enter your recovery password",
"enterSendNewMessageDescription": "ENTER sends a message, SHIFT + ENTER starts a new line",
"accountIdEnter": "Enter Account ID",
"accountIdEnterYourFriends": "Enter your friend's Account ID or ONS",
@ -420,9 +420,7 @@
"recoveryPasswordErrorMessageGeneric": "Please check your recovery password and try again.",
"recoveryPasswordErrorMessageIncorrect": "Some of the words in your Recovery Password are incorrect. Please check and try again.",
"recoveryPasswordErrorMessageShort": "The Recovery Password you entered is not long enough. Please check and try again.",
"recoveryPhrase": "Recovery Phrase",
"recoveryPhraseEmpty": "Enter your recovery phrase",
"recoveryPhraseSavePromptMain": "Your recovery phrase is the master key to your Account ID — you can use it to restore your Account ID if you lose access to your device. Store your recovery phrase in a safe place, and don't give it to anyone.",
"recoveryPhraseSavePromptMain": "Your recovery password is the master key to your Account ID — you can use it to restore your Account ID if you lose access to your device. Store your recovery password in a safe place, and don't give it to anyone.",
"remove": "Remove",
"removeAccountPasswordDescription": "Remove the password required to unlock Session.",
"removeAccountPasswordTitle": "Remove Password",
@ -441,7 +439,6 @@
"resend": "Resend",
"resolution": "Resolution",
"messageRequestsAcceptDescription": "Sending a message to this user will automatically accept their message request and reveal your Account ID.",
"restoreUsingRecoveryPhrase": "Restore your account",
"ringing": "Ringing...",
"save": "Save",
"saved": "Saved",
@ -457,8 +454,8 @@
"sendFailed": "Send Failed",
"sending": "Sending",
"sendMessage": "Message",
"sendRecoveryPhraseMessage": "You are attempting to send your recovery phrase which can be used to access your account. Are you sure you want to send this message?",
"sendRecoveryPhraseTitle": "Sending Recovery Phrase",
"recoveryPasswordWarningSendDescription": "This is your recovery password. If you send it to someone they'll have full access to your account.",
"warning": "Warning",
"sent": "Sent",
"serverId": "Server ID",
"sessionMessenger": "Session",
@ -478,8 +475,7 @@
"shareBugDetails": "Export your logs, then upload the file though Session's Help Desk.",
"show": "Show",
"showDebugLog": "Export Logs",
"showRecoveryPhrase": "Recovery Phrase",
"showRecoveryPhrasePasswordRequest": "Please enter your password",
"passwordCreate": "Create your password",
"showUserDetails": "Show User Details",
"someOfYourDeviceUseOutdatedVersion": "Some of your devices are using outdated versions. Syncing may be unreliable until they are updated.",
"spellCheckDescription": "Enable spell check when typing messages.",

@ -209,8 +209,8 @@ export class SessionConversation extends Component<Props, State> {
if (msg.body.replace(/\s/g, '').includes(recoveryPhrase.replace(/\s/g, ''))) {
window.inboxStore?.dispatch(
updateConfirmModal({
title: window.i18n('sendRecoveryPhraseTitle'),
message: window.i18n('sendRecoveryPhraseMessage'),
title: window.i18n('warning'),
message: window.i18n('recoveryPasswordWarningSendDescription'),
okTheme: SessionButtonColor.Danger,
onClickOk: () => {
void sendAndScroll();

@ -220,7 +220,7 @@ const SessionSeedModalInner = (props: ModalInnerProps) => {
<>
{!loadingSeed && (
<SessionWrapperModal
title={window.i18n('showRecoveryPhrase')}
title={window.i18n('sessionRecoveryPassword')}
onClose={onClose}
showExitIcon={true}
>

@ -72,8 +72,8 @@ const getCategories = () => {
title: window.i18n('helpSettingsTitle'),
},
{
id: SessionSettingCategory.RecoveryPhrase,
title: window.i18n('recoveryPhrase'),
id: SessionSettingCategory.RecoveryPassword,
title: window.i18n('sessionRecoveryPassword'),
},
{
id: SessionSettingCategory.ClearData,
@ -107,7 +107,7 @@ const LeftPaneSettingsCategoryRow = (props: {
dispatch(setLeftOverlayMode('message-requests'));
dispatch(resetConversationExternal());
break;
case SessionSettingCategory.RecoveryPhrase:
case SessionSettingCategory.RecoveryPassword:
dispatch(recoveryPhraseModal({}));
break;
case SessionSettingCategory.ClearData:

@ -58,7 +58,7 @@ async function signInWithNewDisplayName(signInDetails: RecoverDetails) {
}
/**
* This will try to sign in with the user recovery phrase.
* This will try to sign in with the user recovery password.
* If no ConfigurationMessage is received within ONBOARDING_RECOVERY_TIMEOUT, the user will be asked to enter a display name.
*/
async function signInAndFetchDisplayName(
@ -228,12 +228,12 @@ export const RestoreAccount = () => {
autoFocus={true}
disabledOnBlur={true}
type="password"
placeholder={window.i18n('enterRecoveryPhrase')}
placeholder={window.i18n('recoveryPasswordEnter')}
value={recoveryPassword}
onValueChanged={(seed: string) => {
dispatch(setRecoveryPassword(seed));
setRecoveryPasswordError(
!seed ? window.i18n('recoveryPhraseEmpty') : undefined
!seed ? window.i18n('recoveryPasswordEnter') : undefined
);
}}
onEnterPressed={recoverAndFetchDisplayName}

@ -50,7 +50,7 @@ export enum SessionSettingCategory {
Appearance = 'appearance',
Permissions = 'permissions',
Help = 'help',
RecoveryPhrase = 'recoveryPhrase',
RecoveryPassword = 'recoveryPassword',
ClearData = 'ClearData',
}
@ -139,7 +139,7 @@ const SettingInCategory = (props: {
// these three down there have no options, they are just a button
case SessionSettingCategory.ClearData:
case SessionSettingCategory.MessageRequests:
case SessionSettingCategory.RecoveryPhrase:
case SessionSettingCategory.RecoveryPassword:
default:
return null;
}

@ -45,7 +45,7 @@ export const SettingsHeader = (props: Props) => {
break;
case SessionSettingCategory.ClearData:
case SessionSettingCategory.MessageRequests:
case SessionSettingCategory.RecoveryPhrase:
case SessionSettingCategory.RecoveryPassword:
throw new Error(`no header for should be tried to be rendered for "${category}"`);
default:

@ -194,7 +194,6 @@ export type LocalizerKeys =
| 'enterNewLineDescription'
| 'enterNewPassword'
| 'enterPassword'
| 'enterRecoveryPhrase'
| 'enterSendNewMessageDescription'
| 'entireAccount'
| 'error'
@ -383,6 +382,7 @@ export type LocalizerKeys =
| 'otherSingular'
| 'password'
| 'passwordCharacterError'
| 'passwordCreate'
| 'passwordLengthError'
| 'passwordTypeError'
| 'passwordViewTitle'
@ -420,11 +420,11 @@ export type LocalizerKeys =
| 'readReceiptSettingDescription'
| 'readReceiptSettingTitle'
| 'received'
| 'recoveryPasswordEnter'
| 'recoveryPasswordErrorMessageGeneric'
| 'recoveryPasswordErrorMessageIncorrect'
| 'recoveryPasswordErrorMessageShort'
| 'recoveryPhrase'
| 'recoveryPhraseEmpty'
| 'recoveryPasswordWarningSendDescription'
| 'recoveryPhraseSavePromptMain'
| 'remove'
| 'removeAccountPasswordDescription'
@ -443,7 +443,6 @@ export type LocalizerKeys =
| 'requestsSubtitle'
| 'resend'
| 'resolution'
| 'restoreUsingRecoveryPhrase'
| 'ringing'
| 'save'
| 'saveLogToDesktop'
@ -458,8 +457,6 @@ export type LocalizerKeys =
| 'selectMessage'
| 'sendFailed'
| 'sendMessage'
| 'sendRecoveryPhraseMessage'
| 'sendRecoveryPhraseTitle'
| 'sending'
| 'sent'
| 'serverId'
@ -480,8 +477,6 @@ export type LocalizerKeys =
| 'shareBugDetails'
| 'show'
| 'showDebugLog'
| 'showRecoveryPhrase'
| 'showRecoveryPhrasePasswordRequest'
| 'showUserDetails'
| 'someOfYourDeviceUseOutdatedVersion'
| 'spellCheckDescription'
@ -579,6 +574,7 @@ export type LocalizerKeys =
| 'viewMenuZoomOut'
| 'voiceMessage'
| 'waitOneMoment'
| 'warning'
| 'welcomeToYourSession'
| 'windowMenuClose'
| 'windowMenuMinimize'
@ -593,5 +589,4 @@ export type LocalizerKeys =
| 'youHaveANewFriendRequest'
| 'youLeftTheGroup'
| 'youSetYourDisappearingMessages'
| 'yourUniqueSessionID'
| 'zoomFactorSettingTitle';

@ -60,7 +60,7 @@ const generateKeypair = async (
};
/**
* Sign in with a recovery phrase. We won't try to recover an existing profile name
* Sign in with a recovery password. We won't try to recover an existing profile name
* @param mnemonic the mnemonic the user duly saved in a safe place. We will restore his sessionID based on this.
* @param mnemonicLanguage 'english' only is supported
* @param profileName the displayName to use for this user
@ -74,7 +74,7 @@ export async function signInWithRecovery(
}
/**
* Sign in with a recovery phrase and try to recover display name and avatar from the first encountered configuration message.
* Sign in with a recovery password and try to recover display name and avatar from the first encountered configuration message.
* @param mnemonic the mnemonic the user duly saved in a safe place. We will restore his sessionID based on this.
* @param mnemonicLanguage 'english' only is supported
* @param loadingAnimationCallback a callback to trigger a loading animation

Loading…
Cancel
Save