Skip to content

Commit

Permalink
Remove trailing padding from OATH secret
Browse files Browse the repository at this point in the history
  • Loading branch information
elibon99 committed Jan 13, 2025
1 parent 8d5f721 commit 8ea344f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/oath/views/add_account_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ class _OathAddAccountPageState extends ConsumerState<OathAddAccountPage> {
final issuerMaxLength = max(issuerRemaining, 1);
final nameMaxLength = max(nameRemaining, 1);

final secret = _secretController.text.replaceAll(' ', '');
// Remove whitespace and padding
final secret = _secretController.text.replaceAll(RegExp(r'[\s=]'), '');
final secretLengthValid = secret.length * 5 % 8 < 5;
final secretFormatValid = Format.base32.isValid(secret);

Expand Down

0 comments on commit 8ea344f

Please sign in to comment.