Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[auth] Minor fixes

Aman Raj Singh Mourya2aa953d5b613
diff --git a/auth/lib/models/code.dart b/auth/lib/models/code.dart
index a2fd2d7e4a..5bba391953 100644
--- a/auth/lib/models/code.dart
+++ b/auth/lib/models/code.dart
@@ -116,16 +116,17 @@ class Code {
Algorithm? algorithm,
) {
final String encodedIssuer = Uri.encodeQueryComponent(issuer);
+ final Algorithm algo = algorithm ?? Algorithm.sha1;
return Code(
account,
issuer,
digits,
defaultPeriod,
secret,
- algorithm ?? Algorithm.sha1,
+ algo,
type,
0,
- "otpauth://${type.name}/$issuer:$account?algorithm=SHA1&digits=$digits&issuer=$encodedIssuer&period=30&secret=$secret",
+ "otpauth://${type.name}/$issuer:$account?algorithm=${algo.name.toUpperCase()}&digits=$digits&issuer=$encodedIssuer&period=30&secret=$secret",
display: display ?? CodeDisplay(),
);
}