Preparing to move authentication caching responsibility

contributes to iOS-319
This commit is contained in:
shannon 2024-11-18 15:35:37 -05:00
parent 1e472c8232
commit 6af4c528e4
2 changed files with 4 additions and 5 deletions

View File

@ -128,7 +128,7 @@ extension MastodonConfirmEmailViewController {
}
.store(in: &self.context.disposeBag) // execute in the background
} // end switch
} receiveValue: { response in
} receiveValue: { _ in
self.coordinator.setup()
// self.dismiss(animated: true, completion: nil)
}

View File

@ -175,14 +175,14 @@ extension AuthenticationViewModel {
context: AppContext,
info: AuthenticateInfo,
userToken: Mastodon.Entity.Token
) -> AnyPublisher<Mastodon.Response.Content<Mastodon.Entity.Account>, Error> {
) -> AnyPublisher<MastodonAuthentication, Error> {
let authorization = Mastodon.API.OAuth.Authorization(accessToken: userToken.accessToken)
return APIService.shared.accountVerifyCredentials(
domain: info.domain,
authorization: authorization
)
.tryMap { response -> Mastodon.Response.Content<Mastodon.Entity.Account> in
.tryMap { response -> MastodonAuthentication in
let account = response.value
let authentication = MastodonAuthentication.createFrom(domain: info.domain,
@ -198,8 +198,7 @@ extension AuthenticationViewModel {
.authentications
.insert(authentication, at: 0)
return response
return authentication
}
.eraseToAnyPublisher()
}