fix: don't use name length for the recovery password input and trim it

pull/3137/head
yougotwill 8 months ago
parent e66d443a97
commit d52461aecc

@ -133,13 +133,15 @@ export const RestoreAccount = () => {
if (!(!!recoveryPassword && !recoveryPasswordError)) {
return;
}
const trimmedPassword = recoveryPassword.trim();
setRecoveryPassword(trimmedPassword);
const abortController = new AbortController();
try {
dispatch(setProgress(0));
dispatch(setAccountRestorationStep(AccountRestoration.Loading));
await signInAndFetchDisplayName({
recoveryPassword,
recoveryPassword: trimmedPassword,
dispatch,
abortSignal: abortController.signal,
});
@ -248,7 +250,6 @@ export const RestoreAccount = () => {
}}
onEnterPressed={recoverAndFetchDisplayName}
error={recoveryPasswordError}
maxLength={LIBSESSION_CONSTANTS.CONTACT_MAX_NAME_LENGTH}
enableShowHideButton={true}
showHideButtonAriaLabels={{
hide: 'Hide recovery password toggle',
@ -289,6 +290,7 @@ export const RestoreAccount = () => {
}}
onEnterPressed={recoverAndEnterDisplayName}
error={displayNameError}
maxLength={LIBSESSION_CONSTANTS.CONTACT_MAX_NAME_LENGTH}
inputDataTestId="display-name-input"
/>
<SpacerLG />

Loading…
Cancel
Save