Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit b2d3120

Browse files
committed
Move notifying the host app of successful authentication to after a successful call to createWPComUserWithApple.
1 parent 7190b82 commit b2d3120

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

WordPressAuthenticator/Signin/AppleAuthenticator.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

0 commit comments

Comments
 (0)