SCSDKLoginClient's completion is called twice
We convert SCSDKLoginClient.login(from:)
from a completion handler to async await here. We were getting a bunch of crashes because continuation.resume()
was being called twice - meaning the completion handler was being called twice.
@MainActor func login(from viewController: UIViewController) async throws -> Bool { var completed = false return try await withCheckedThrowingContinuation { continuation in SCSDKLoginClient.login(from: viewController) { success, error in guard !completed else { return } completed = true if let error { continuation.resume(throwing: error) } else { continuation.resume(returning: success) } } } }
Tagged:
0
Answers
-
Just copy and pasted that code block into the Login Kit test app, and I'm not able to repro - it's just getting called once. Is it possible the login method is being called twice?
0