@@ -77,6 +77,9 @@ private extension AppleAuthenticator {
7777 success: { [ weak self] accountCreated, existingNonSocialAccount, wpcomUsername, wpcomToken in
7878 SVProgressHUD . dismiss ( )
7979
80+ // Notify host app of successful Apple authentication
81+ self ? . authenticationDelegate. userAuthenticatedWithAppleUserID ( appleCredentials. user)
82+
8083 guard !existingNonSocialAccount else {
8184 self ? . logInInstead ( )
8285 return
@@ -168,7 +171,6 @@ extension AppleAuthenticator: ASAuthorizationControllerDelegate {
168171 func authorizationController( controller: ASAuthorizationController , didCompleteWithAuthorization authorization: ASAuthorization ) {
169172 switch authorization. credential {
170173 case let credentials as ASAuthorizationAppleIDCredential :
171- authenticationDelegate. userAuthenticatedWithAppleUserID ( credentials. user)
172174 createWordPressComUser ( appleCredentials: credentials)
173175 default :
174176 break
@@ -199,8 +201,8 @@ extension AppleAuthenticator: ASAuthorizationControllerPresentationContextProvid
199201
200202@available ( iOS 13 . 0 , * )
201203extension AppleAuthenticator {
202- func checkAppleIDCredentialState ( for userID: String ,
203- completion: @escaping ( ASAuthorizationAppleIDProvider . CredentialState , Error ? ) -> Void ) {
204+ func getAppleIDCredentialState ( for userID: String ,
205+ completion: @escaping ( ASAuthorizationAppleIDProvider . CredentialState , Error ? ) -> Void ) {
204206 ASAuthorizationAppleIDProvider ( ) . getCredentialState ( forUserID: userID, completion: completion)
205207 }
206208}
0 commit comments