This commit is contained in:
2026-02-18 21:53:01 +01:00
parent 4c0d8be018
commit 2534011506
2 changed files with 17 additions and 21 deletions

View File

@@ -12,7 +12,7 @@ final class AuthService: NSObject {
super.init()
}
func login(presentationAnchor: ASPresentationAnchor) async throws {
func login(presentationAnchor: ASPresentationAnchor?) async throws {
self.presentationAnchor = presentationAnchor
let codeVerifier = generateCodeVerifier()
@@ -79,15 +79,14 @@ final class AuthService: NSObject {
self.authSession = webAuthSession
webAuthSession.start { started in
if !started {
DispatchQueue.main.async {
NotificationCenter.default.post(
name: .authError,
object: nil,
userInfo: ["error": AuthError.failed("Failed to start auth session")]
)
}
let started = webAuthSession.start()
if !started {
DispatchQueue.main.async {
NotificationCenter.default.post(
name: .authError,
object: nil,
userInfo: ["error": AuthError.failed("Failed to start auth session")]
)
}
}
}