Display apple sign in error message

This commit is contained in:
Ilya Laktyushin 2024-03-16 15:45:15 +04:00
parent bb1b425217
commit f557e0e606
2 changed files with 13 additions and 0 deletions

View File

@ -801,6 +801,14 @@ public final class AuthorizationSequenceController: NavigationController, ASAuth
}
}
@available(iOS 13.0, *)
public func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) {
guard let lastController = self.viewControllers.last as? ViewController else {
return
}
lastController.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: self.presentationData), title: nil, text: error.localizedDescription, actions: [TextAlertAction(type: .defaultAction, title: self.presentationData.strings.Common_OK, action: {})]), in: .window(.root))
}
@available(iOS 13.0, *)
public func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor {
return self.view.window!

View File

@ -654,6 +654,11 @@ class PrivacyAndSecurityControllerImpl: ItemListController, ASAuthorizationContr
self.authorizationCompletion?(authorization.credential)
}
@available(iOS 13.0, *)
public func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) {
Logger.shared.log("AppleSignIn", "Failed with error: \(error.localizedDescription)")
}
@available(iOS 13.0, *)
public func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor {
return self.view.window!