mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-23 09:56:23 +03:00
Don't use hex validation for PIN
This commit is contained in:
parent
c66f96016b
commit
fdc4c7547e
@ -90,12 +90,13 @@ class _ManageKeyDialogState extends ConsumerState<ManageKeyDialog> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_submit() async {
|
_submit() async {
|
||||||
final currentInvalidFormat = Format.hex.isValid(_currentController.text);
|
final currentValidFormat =
|
||||||
final newInvalidFormat = Format.hex.isValid(_keyController.text);
|
_usesStoredKey || Format.hex.isValid(_currentController.text);
|
||||||
if (!currentInvalidFormat || !newInvalidFormat) {
|
final newValidFormat = Format.hex.isValid(_keyController.text);
|
||||||
|
if (!currentValidFormat || !newValidFormat) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_currentInvalidFormat = !currentInvalidFormat;
|
_currentInvalidFormat = !currentValidFormat;
|
||||||
_newInvalidFormat = !newInvalidFormat;
|
_newInvalidFormat = !newValidFormat;
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -202,9 +203,6 @@ class _ManageKeyDialogState extends ConsumerState<ManageKeyDialog> {
|
|||||||
helperText: _defaultPinUsed ? l10n.l_default_pin_used : null,
|
helperText: _defaultPinUsed ? l10n.l_default_pin_used : null,
|
||||||
errorText: _currentIsWrong
|
errorText: _currentIsWrong
|
||||||
? l10n.l_wrong_pin_attempts_remaining(_attemptsRemaining)
|
? l10n.l_wrong_pin_attempts_remaining(_attemptsRemaining)
|
||||||
: _currentInvalidFormat
|
|
||||||
? l10n.l_invalid_format_allowed_chars(
|
|
||||||
Format.hex.allowedCharacters)
|
|
||||||
: null,
|
: null,
|
||||||
errorMaxLines: 3,
|
errorMaxLines: 3,
|
||||||
prefixIcon: const Icon(Symbols.pin),
|
prefixIcon: const Icon(Symbols.pin),
|
||||||
|
Loading…
Reference in New Issue
Block a user