Preparing to move authentication caching responsibility
contributes to iOS-319
This commit is contained in:
parent
1e472c8232
commit
6af4c528e4
@ -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)
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user