mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
18 lines
572 B
Swift
18 lines
572 B
Swift
import Foundation
|
|
import Models
|
|
|
|
public extension Authenticator {
|
|
func submitAppleToken(token: String) async throws {
|
|
do {
|
|
let authPayload = try await networker.submitAppleToken(token: token)
|
|
try ValetKey.authCookieString.setValue(authPayload.commentedAuthCookieString)
|
|
try ValetKey.authToken.setValue(authPayload.authToken)
|
|
DispatchQueue.main.async {
|
|
self.isLoggedIn = true
|
|
}
|
|
} catch {
|
|
let serverError = (error as? ServerError) ?? ServerError.unknown
|
|
throw LoginError.make(serverError: serverError)
|
|
}
|
|
}
|
|
}
|