@@ -622,7 +622,33 @@ - (void)authorizationController:(ASAuthorizationController *)controller
622622- (void )authorizationController : (ASAuthorizationController *)controller
623623 didCompleteWithError : (NSError *)error API_AVAILABLE(macos(10.15 ), ios(13.0 )) {
624624 NSLog (@" Sign in with Apple errored: %@ " , error);
625- self.appleResult .error (nil , nil , nil , error);
625+ switch (error.code ) {
626+ case ASAuthorizationErrorCanceled:
627+ self.appleResult .error (@" canceled" , @" The user canceled the authorization attempt." , nil ,
628+ error);
629+ break ;
630+
631+ case ASAuthorizationErrorInvalidResponse:
632+ self.appleResult .error (@" invalid-response" ,
633+ @" The authorization request received an invalid response." , nil ,
634+ error);
635+ break ;
636+
637+ case ASAuthorizationErrorNotHandled:
638+ self.appleResult .error (@" not-handled" , @" The authorization request wasn’t handled." , nil ,
639+ error);
640+ break ;
641+
642+ case ASAuthorizationErrorFailed:
643+ self.appleResult .error (@" failed" , @" The authorization attempt failed." , nil , error);
644+ break ;
645+
646+ case ASAuthorizationErrorUnknown:
647+ default :
648+ self.appleResult .error (nil , nil , nil , error);
649+ break ;
650+ }
651+ self.appleResult = nil ;
626652}
627653
628654- (void )signInWithProvider : (id )arguments
0 commit comments