mirror of
https://github.com/appwrite/sdk-for-apple.git
synced 2026-04-07 19:17:50 +00:00
Backport oauth XPC interrupt fix
This commit is contained in:
@@ -939,7 +939,7 @@ open class Account: Service {
|
||||
success: String? = nil,
|
||||
failure: String? = nil,
|
||||
scopes: [String]? = nil
|
||||
) throws -> Bool {
|
||||
) async throws -> Bool {
|
||||
let path: String = "/account/sessions/oauth2/{provider}"
|
||||
.replacingOccurrences(of: "{provider}", with: provider)
|
||||
|
||||
@@ -953,13 +953,12 @@ open class Account: Service {
|
||||
let query = "?\(client.parametersToQueryString(params: params))"
|
||||
let url = URL(string: client.endPoint + path + query)!
|
||||
let callbackScheme = "appwrite-callback-\(client.config["project"] ?? "")"
|
||||
let group = DispatchGroup()
|
||||
|
||||
group.enter()
|
||||
WebAuthComponent.authenticate(url: url, callbackScheme: callbackScheme) { result in
|
||||
group.leave()
|
||||
|
||||
try await withCheckedThrowingContinuation { continuation in
|
||||
WebAuthComponent.authenticate(url: url, callbackScheme: callbackScheme) { result in
|
||||
continuation.resume(with: result)
|
||||
}
|
||||
}
|
||||
group.wait()
|
||||
|
||||
return true
|
||||
|
||||
@@ -1374,4 +1373,4 @@ open class Account: Service {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user