SHA256
CORE/CONTENT test5593 и адаптация UI
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { t } from '../i18n/index.js';
|
||||
import { confirmDialog } from '../components/confirm-dialog.js';
|
||||
|
||||
// Не обрезаем пароль: пробелы участвуют в формировании криптографических ключей.
|
||||
// Предупреждаем только при выборе НОВОГО пароля, а не при авторизации.
|
||||
export function confirmPasswordBoundarySpaces(password) {
|
||||
const value = String(password ?? '');
|
||||
const starts = /^\s/u.test(value);
|
||||
const ends = /\s$/u.test(value);
|
||||
if (!starts && !ends) return Promise.resolve(true);
|
||||
const where = starts && ends ? t('remaining.password.starts_and_ends_with_a_space')
|
||||
: starts ? t('remaining.password.starts_with_a_space') : t('remaining.password.ends_with_a_space');
|
||||
return confirmDialog({
|
||||
title: t('remaining.password.space_in_password'),
|
||||
text: t('remaining.password.warning', { where }),
|
||||
confirmLabel: t('remaining.password.keep_password_as_entered'),
|
||||
cancelLabel: t('remaining.password.edit_password'),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user