mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-28 12:43:11 +03:00
Add account: check length of issuer and name
This commit is contained in:
parent
f6aeb0b9f0
commit
4c39e793cd
@ -104,8 +104,11 @@ class _OathAddAccountPageState extends ConsumerState<OathAddAccountPage> {
|
|||||||
|
|
||||||
final secret = _secretController.text.replaceAll(' ', '');
|
final secret = _secretController.text.replaceAll(' ', '');
|
||||||
final secretLengthValid = secret.length * 5 % 8 < 5;
|
final secretLengthValid = secret.length * 5 % 8 < 5;
|
||||||
final isValid =
|
final isValid = _accountController.text.isNotEmpty &&
|
||||||
_accountController.text.isNotEmpty && secret.isNotEmpty && period > 0;
|
secret.isNotEmpty &&
|
||||||
|
issuerRemaining >= -1 &&
|
||||||
|
nameRemaining >= 0 &&
|
||||||
|
period > 0;
|
||||||
|
|
||||||
final qrScanner = ref.watch(qrScannerProvider);
|
final qrScanner = ref.watch(qrScannerProvider);
|
||||||
|
|
||||||
@ -154,7 +157,7 @@ class _OathAddAccountPageState extends ConsumerState<OathAddAccountPage> {
|
|||||||
),
|
),
|
||||||
TextField(
|
TextField(
|
||||||
controller: _accountController,
|
controller: _accountController,
|
||||||
maxLength: nameRemaining,
|
maxLength: max(nameRemaining, 1),
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
labelText: 'Account name',
|
labelText: 'Account name',
|
||||||
|
Loading…
Reference in New Issue
Block a user