Skip to content

Commit

Permalink
Changed 'tokenStore' into 'tokenStorage' be more consistent and add '…
Browse files Browse the repository at this point in the history
…withBackgroundSession'
  • Loading branch information
iammajid committed Jun 21, 2024
1 parent dff8569 commit fbaf000
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class AccountListViewModel: AccountListViewModelProtocol {
return all(accountInfos
.map { accountInfo in
let tokenStore = BoxTokenStore()
let credential = BoxCredential(tokenStore: tokenStore)
let credential = BoxCredential(tokenStorage: tokenStore)
boxCredentials[accountInfo.accountUID] = credential // Workaround: Fixing lifecycle issue with Box credential/client
return credential
}
Expand Down
4 changes: 2 additions & 2 deletions Cryptomator/Common/CloudAuthenticator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class CloudAuthenticator {

func authenticateBox(from viewController: UIViewController) -> Promise<CloudProviderAccount> {
let tokenStore = BoxTokenStore()
let credential = BoxCredential(tokenStore: tokenStore)
let credential = BoxCredential(tokenStorage: tokenStore)

return BoxAuthenticator.authenticate(from: viewController, tokenStorage: tokenStore).then { _ -> Promise<CloudProviderAccount> in
return credential.getUserId().then { userId in
Expand Down Expand Up @@ -114,7 +114,7 @@ class CloudAuthenticator {
switch account.cloudProviderType {
case .box:
let tokenStore = BoxTokenStore()
let credential = BoxCredential(tokenStore: tokenStore)
let credential = BoxCredential(tokenStorage: tokenStore)
credential.deauthenticate()
case .dropbox:
let credential = DropboxCredential(tokenUID: account.accountUID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class VaultDetailInfoFooterViewModel: BindableAttributedTextHeaderFooterViewMode
switch vault.cloudProviderType {
case .box:
let tokenStore = BoxTokenStore()
let credential = BoxCredential(tokenStore: tokenStore)
let credential = BoxCredential(tokenStorage: tokenStore)
getUsername(for: credential)
return "(…)"
case .dropbox:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class CloudProviderDBManager: CloudProviderManager, CloudProviderUpdating
provider = try PCloudCloudProvider(client: client)
case .box:
let tokenStore = BoxTokenStore()
let credential = BoxCredential(tokenStore: tokenStore)
let credential = BoxCredential(tokenStorage: tokenStore)
provider = try BoxCloudProvider(credential: credential, maxPageSize: .max)
case .webDAV:
let credential = try getWebDAVCredential(for: accountUID)
Expand Down Expand Up @@ -128,8 +128,8 @@ public class CloudProviderDBManager: CloudProviderManager, CloudProviderUpdating
provider = try PCloudCloudProvider(client: client)
case .box:
let tokenStore = BoxTokenStore()
let credential = BoxCredential(tokenStore: tokenStore)
provider = try BoxCloudProvider(credential: credential, maxPageSize: maxPageSizeForFileProvider)
let credential = BoxCredential(tokenStorage: tokenStore)
provider = try BoxCloudProvider.withBackgroundSession(credential: credential, maxPageSize: maxPageSizeForFileProvider, sessionIdentifier: sessionIdentifier)
case .webDAV:
let credential = try getWebDAVCredential(for: accountUID)
let client = WebDAVClient.withBackgroundSession(credential: credential, sessionIdentifier: sessionIdentifier, sharedContainerIdentifier: CryptomatorConstants.appGroupName)
Expand Down

0 comments on commit fbaf000

Please sign in to comment.