TF-605 Use bearer token download attachment on iOS

This commit is contained in:
dab246
2022-06-02 16:46:08 +07:00
committed by Dat H. Pham
parent 693f4dbc15
commit 69b2dbf3cf
9 changed files with 96 additions and 18 deletions
@@ -194,11 +194,17 @@ class EmailAPI {
AccountRequest accountRequest,
CancelToken cancelToken
) async {
final authentication = accountRequest.authenticationType == AuthenticationType.oidc
? accountRequest.bearerToken
: accountRequest.basicAuth;
log('EmailAPI::exportAttachment(): authentication: $authentication');
return _downloadManager.downloadFile(
attachment.getDownloadUrl(baseDownloadUrl, accountId),
getTemporaryDirectory(),
attachment.name ?? '',
accountRequest.basicAuth,
authentication,
cancelToken: cancelToken);
}