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", "enterNewLineDescription": "SHIFT + ENTER sends a message, ENTER starts a new line",
"enterNewPassword": "Please enter your new password", "enterNewPassword": "Please enter your new password",
"enterPassword": "Please enter your 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", "enterSendNewMessageDescription": "ENTER sends a message, SHIFT + ENTER starts a new line",
"accountIdEnter": "Enter Account ID", "accountIdEnter": "Enter Account ID",
"accountIdEnterYourFriends": "Enter your friend's Account ID or ONS", "accountIdEnterYourFriends": "Enter your friend's Account ID or ONS",
@ -420,9 +420,7 @@
"recoveryPasswordErrorMessageGeneric": "Please check your recovery password and try again.", "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.", "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.", "recoveryPasswordErrorMessageShort": "The Recovery Password you entered is not long enough. Please check and try again.",
"recoveryPhrase": "Recovery Phrase", "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.",
"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.",
"remove": "Remove", "remove": "Remove",
"removeAccountPasswordDescription": "Remove the password required to unlock Session.", "removeAccountPasswordDescription": "Remove the password required to unlock Session.",
"removeAccountPasswordTitle": "Remove Password", "removeAccountPasswordTitle": "Remove Password",
@ -441,7 +439,6 @@
"resend": "Resend", "resend": "Resend",
"resolution": "Resolution", "resolution": "Resolution",
"messageRequestsAcceptDescription": "Sending a message to this user will automatically accept their message request and reveal your Account ID.", "messageRequestsAcceptDescription": "Sending a message to this user will automatically accept their message request and reveal your Account ID.",
"restoreUsingRecoveryPhrase": "Restore your account",
"ringing": "Ringing...", "ringing": "Ringing...",
"save": "Save", "save": "Save",
"saved": "Saved", "saved": "Saved",
@ -457,8 +454,8 @@
"sendFailed": "Send Failed", "sendFailed": "Send Failed",
"sending": "Sending", "sending": "Sending",
"sendMessage": "Message", "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?", "recoveryPasswordWarningSendDescription": "This is your recovery password. If you send it to someone they'll have full access to your account.",
"sendRecoveryPhraseTitle": "Sending Recovery Phrase", "warning": "Warning",
"sent": "Sent", "sent": "Sent",
"serverId": "Server ID", "serverId": "Server ID",
"sessionMessenger": "Session", "sessionMessenger": "Session",
@ -478,8 +475,7 @@
"shareBugDetails": "Export your logs, then upload the file though Session's Help Desk.", "shareBugDetails": "Export your logs, then upload the file though Session's Help Desk.",
"show": "Show", "show": "Show",
"showDebugLog": "Export Logs", "showDebugLog": "Export Logs",
"showRecoveryPhrase": "Recovery Phrase", "passwordCreate": "Create your password",
"showRecoveryPhrasePasswordRequest": "Please enter your password",
"showUserDetails": "Show User Details", "showUserDetails": "Show User Details",
"someOfYourDeviceUseOutdatedVersion": "Some of your devices are using outdated versions. Syncing may be unreliable until they are updated.", "someOfYourDeviceUseOutdatedVersion": "Some of your devices are using outdated versions. Syncing may be unreliable until they are updated.",
"spellCheckDescription": "Enable spell check when typing messages.", "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, ''))) { if (msg.body.replace(/\s/g, '').includes(recoveryPhrase.replace(/\s/g, ''))) {
window.inboxStore?.dispatch( window.inboxStore?.dispatch(
updateConfirmModal({ updateConfirmModal({
title: window.i18n('sendRecoveryPhraseTitle'), title: window.i18n('warning'),
message: window.i18n('sendRecoveryPhraseMessage'), message: window.i18n('recoveryPasswordWarningSendDescription'),
okTheme: SessionButtonColor.Danger, okTheme: SessionButtonColor.Danger,
onClickOk: () => { onClickOk: () => {
void sendAndScroll(); void sendAndScroll();

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

@ -72,8 +72,8 @@ const getCategories = () => {
title: window.i18n('helpSettingsTitle'), title: window.i18n('helpSettingsTitle'),
}, },
{ {
id: SessionSettingCategory.RecoveryPhrase, id: SessionSettingCategory.RecoveryPassword,
title: window.i18n('recoveryPhrase'), title: window.i18n('sessionRecoveryPassword'),
}, },
{ {
id: SessionSettingCategory.ClearData, id: SessionSettingCategory.ClearData,
@ -107,7 +107,7 @@ const LeftPaneSettingsCategoryRow = (props: {
dispatch(setLeftOverlayMode('message-requests')); dispatch(setLeftOverlayMode('message-requests'));
dispatch(resetConversationExternal()); dispatch(resetConversationExternal());
break; break;
case SessionSettingCategory.RecoveryPhrase: case SessionSettingCategory.RecoveryPassword:
dispatch(recoveryPhraseModal({})); dispatch(recoveryPhraseModal({}));
break; break;
case SessionSettingCategory.ClearData: 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. * If no ConfigurationMessage is received within ONBOARDING_RECOVERY_TIMEOUT, the user will be asked to enter a display name.
*/ */
async function signInAndFetchDisplayName( async function signInAndFetchDisplayName(
@ -228,12 +228,12 @@ export const RestoreAccount = () => {
autoFocus={true} autoFocus={true}
disabledOnBlur={true} disabledOnBlur={true}
type="password" type="password"
placeholder={window.i18n('enterRecoveryPhrase')} placeholder={window.i18n('recoveryPasswordEnter')}
value={recoveryPassword} value={recoveryPassword}
onValueChanged={(seed: string) => { onValueChanged={(seed: string) => {
dispatch(setRecoveryPassword(seed)); dispatch(setRecoveryPassword(seed));
setRecoveryPasswordError( setRecoveryPasswordError(
!seed ? window.i18n('recoveryPhraseEmpty') : undefined !seed ? window.i18n('recoveryPasswordEnter') : undefined
); );
}} }}
onEnterPressed={recoverAndFetchDisplayName} onEnterPressed={recoverAndFetchDisplayName}

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

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

@ -194,7 +194,6 @@ export type LocalizerKeys =
| 'enterNewLineDescription' | 'enterNewLineDescription'
| 'enterNewPassword' | 'enterNewPassword'
| 'enterPassword' | 'enterPassword'
| 'enterRecoveryPhrase'
| 'enterSendNewMessageDescription' | 'enterSendNewMessageDescription'
| 'entireAccount' | 'entireAccount'
| 'error' | 'error'
@ -383,6 +382,7 @@ export type LocalizerKeys =
| 'otherSingular' | 'otherSingular'
| 'password' | 'password'
| 'passwordCharacterError' | 'passwordCharacterError'
| 'passwordCreate'
| 'passwordLengthError' | 'passwordLengthError'
| 'passwordTypeError' | 'passwordTypeError'
| 'passwordViewTitle' | 'passwordViewTitle'
@ -420,11 +420,11 @@ export type LocalizerKeys =
| 'readReceiptSettingDescription' | 'readReceiptSettingDescription'
| 'readReceiptSettingTitle' | 'readReceiptSettingTitle'
| 'received' | 'received'
| 'recoveryPasswordEnter'
| 'recoveryPasswordErrorMessageGeneric' | 'recoveryPasswordErrorMessageGeneric'
| 'recoveryPasswordErrorMessageIncorrect' | 'recoveryPasswordErrorMessageIncorrect'
| 'recoveryPasswordErrorMessageShort' | 'recoveryPasswordErrorMessageShort'
| 'recoveryPhrase' | 'recoveryPasswordWarningSendDescription'
| 'recoveryPhraseEmpty'
| 'recoveryPhraseSavePromptMain' | 'recoveryPhraseSavePromptMain'
| 'remove' | 'remove'
| 'removeAccountPasswordDescription' | 'removeAccountPasswordDescription'
@ -443,7 +443,6 @@ export type LocalizerKeys =
| 'requestsSubtitle' | 'requestsSubtitle'
| 'resend' | 'resend'
| 'resolution' | 'resolution'
| 'restoreUsingRecoveryPhrase'
| 'ringing' | 'ringing'
| 'save' | 'save'
| 'saveLogToDesktop' | 'saveLogToDesktop'
@ -458,8 +457,6 @@ export type LocalizerKeys =
| 'selectMessage' | 'selectMessage'
| 'sendFailed' | 'sendFailed'
| 'sendMessage' | 'sendMessage'
| 'sendRecoveryPhraseMessage'
| 'sendRecoveryPhraseTitle'
| 'sending' | 'sending'
| 'sent' | 'sent'
| 'serverId' | 'serverId'
@ -480,8 +477,6 @@ export type LocalizerKeys =
| 'shareBugDetails' | 'shareBugDetails'
| 'show' | 'show'
| 'showDebugLog' | 'showDebugLog'
| 'showRecoveryPhrase'
| 'showRecoveryPhrasePasswordRequest'
| 'showUserDetails' | 'showUserDetails'
| 'someOfYourDeviceUseOutdatedVersion' | 'someOfYourDeviceUseOutdatedVersion'
| 'spellCheckDescription' | 'spellCheckDescription'
@ -579,6 +574,7 @@ export type LocalizerKeys =
| 'viewMenuZoomOut' | 'viewMenuZoomOut'
| 'voiceMessage' | 'voiceMessage'
| 'waitOneMoment' | 'waitOneMoment'
| 'warning'
| 'welcomeToYourSession' | 'welcomeToYourSession'
| 'windowMenuClose' | 'windowMenuClose'
| 'windowMenuMinimize' | 'windowMenuMinimize'
@ -593,5 +589,4 @@ export type LocalizerKeys =
| 'youHaveANewFriendRequest' | 'youHaveANewFriendRequest'
| 'youLeftTheGroup' | 'youLeftTheGroup'
| 'youSetYourDisappearingMessages' | 'youSetYourDisappearingMessages'
| 'yourUniqueSessionID'
| 'zoomFactorSettingTitle'; | '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 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 mnemonicLanguage 'english' only is supported
* @param profileName the displayName to use for this user * @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 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 mnemonicLanguage 'english' only is supported
* @param loadingAnimationCallback a callback to trigger a loading animation * @param loadingAnimationCallback a callback to trigger a loading animation

Loading…
Cancel
Save