TF-2177 Fix download attachment not working on web

Signed-off-by: dab246 <tdvu@linagora.com>
(cherry picked from commit 09cbfe5245c206670aa2191c151fd8f2ea48df3a)
This commit is contained in:
dab246
2023-10-23 23:19:12 +07:00
committed by Dat H. Pham
parent 73a8919f18
commit 424ab675d5
17 changed files with 134 additions and 113 deletions
+18
View File
@@ -19,6 +19,24 @@ class AccountRequest with EquatableMixin {
this.authenticationType = AuthenticationType.none,
});
factory AccountRequest.withOidc({required Token token}) {
return AccountRequest(
token: token,
authenticationType: AuthenticationType.oidc
);
}
factory AccountRequest.withBasic({
required UserName userName,
required Password password
}) {
return AccountRequest(
userName: userName,
password: password,
authenticationType: AuthenticationType.basic
);
}
String get basicAuth => 'Basic ${base64Encode(utf8.encode('${userName?.value}:${password?.value}'))}';
String get bearerToken => 'Bearer ${token?.token}';