[auth] Fix handling of no username during bitwarden import (#2010)

## Description

## Tests
This commit is contained in:
Neeraj Gupta
2024-06-05 10:35:29 +05:30
committed by GitHub
3 changed files with 4 additions and 4 deletions

View File

@@ -109,8 +109,8 @@ Future<int?> _processBitwardenExportFile(
Code.steamDigits,
);
} else {
var issuer = item['name'];
var account = item['login']['username'];
var issuer = item['name'] ?? '';
var account = item['login']['username'] ?? '';
code = Code.fromAccountAndSecret(
Type.totp,
account,

View File

@@ -105,7 +105,7 @@ Future<int?> _processRaivoExportFile(BuildContext context, String path) async {
otpUrl =
'otpauth://$kind/$issuer:$account?secret=$secret&issuer=$issuer&algorithm=$algorithm&digits=$digits&counter=$counter';
} else {
throw Exception('Invalid OTP type');
throw Exception('Invalid OTP type $kind');
}
parsedCodes.add(Code.fromOTPAuthUrl(otpUrl));
}

View File

@@ -1,6 +1,6 @@
name: ente_auth
description: ente two-factor authenticator
version: 3.0.7+307
version: 3.0.8+308
publish_to: none
environment: