[PM-22320] Default to SHA1 on 2fas importer if algorithm is missing (#5875)

This commit is contained in:
aj-rosado 2025-09-13 09:57:13 +01:00 committed by GitHub
parent 4093e61b09
commit 39a6dd1c4b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -74,7 +74,8 @@ class TwoFasExportParser : ExportParser() {
entry.name.equals(other = algorithm, ignoreCase = true)
}
}
?: throw IllegalArgumentException("Unsupported algorithm: ${otp.algorithm}.")
// Default to SHA1 if not specified
?: AuthenticatorItemAlgorithm.SHA1
return AuthenticatorItemEntity(
id = UUID.randomUUID().toString(),