Completed: Import from bitwarden functionality
This commit is contained in:
parent
bed3bd9612
commit
9b759a02a5
1 changed files with 7 additions and 13 deletions
|
@ -93,19 +93,13 @@ Future<int?> _processBitwardenExportFile(
|
||||||
var account = item['login']['username'];
|
var account = item['login']['username'];
|
||||||
var secret = item['login']['totp'];
|
var secret = item['login']['totp'];
|
||||||
|
|
||||||
// Build the OTP URL
|
parsedCodes.add(
|
||||||
String otpUrl;
|
Code.fromAccountAndSecret(
|
||||||
|
account,
|
||||||
if (kind.toLowerCase() == 'totp') {
|
issuer,
|
||||||
otpUrl =
|
secret,
|
||||||
'otpauth://$kind/$issuer:$account?secret=$secret&issuer=$issuer&algorithm=$algorithm&digits=$digits&period=$timer';
|
),
|
||||||
} else if (kind.toLowerCase() == 'hotp') {
|
);
|
||||||
otpUrl =
|
|
||||||
'otpauth://$kind/$issuer:$account?secret=$secret&issuer=$issuer&algorithm=$algorithm&digits=$digits&counter=$counter';
|
|
||||||
} else {
|
|
||||||
throw Exception('Invalid OTP type');
|
|
||||||
}
|
|
||||||
parsedCodes.add(Code.fromRawData(otpUrl));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue