Patil Vaibhav2147 Vp
02/08/2024, 1:13 PMSignInWithAppleButton { request in
request.requestedScopes = [.email, .fullName]
} onCompletion: { result in
Task {
do {
guard let credential = try result.get().credential as? ASAuthorizationAppleIDCredential
else {
return
}
guard let idToken = credential.identityToken
.flatMap({ String(data: $0, encoding: .utf8) })
else {
return
}
try await client.auth.signInWithIdToken(
credentials: .init(
provider: .apple,
idToken: idToken
)
)
} catch {
dump(error)
}
}
}
.fixedSize()
Pablichjenkov
02/08/2024, 3:20 PM