File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Sources/Appwrite/Services Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -939,7 +939,7 @@ open class Account: Service {
939939 success: String ? = nil ,
940940 failure: String ? = nil ,
941941 scopes: [ String ] ? = nil
942- ) throws -> Bool {
942+ ) async throws -> Bool {
943943 let path : String = " /account/sessions/oauth2/{provider} "
944944 . replacingOccurrences ( of: " {provider} " , with: provider)
945945
@@ -953,13 +953,12 @@ open class Account: Service {
953953 let query = " ? \( client. parametersToQueryString ( params: params) ) "
954954 let url = URL ( string: client. endPoint + path + query) !
955955 let callbackScheme = " appwrite-callback- \( client. config [ " project " ] ?? " " ) "
956- let group = DispatchGroup ( )
957-
958- group . enter ( )
959- WebAuthComponent . authenticate ( url : url , callbackScheme : callbackScheme ) { result in
960- group . leave ( )
956+
957+ try await withCheckedThrowingContinuation { continuation in
958+ WebAuthComponent . authenticate ( url : url , callbackScheme : callbackScheme ) { result in
959+ continuation . resume ( with : result )
960+ }
961961 }
962- group. wait ( )
963962
964963 return true
965964
@@ -1374,4 +1373,4 @@ open class Account: Service {
13741373 }
13751374
13761375
1377- }
1376+ }
You can’t perform that action at this time.
0 commit comments