diff --git a/node_modules/@capgo/capacitor-social-login/Package.swift b/node_modules/@capgo/capacitor-social-login/Package.swift index 759c5ff..68e33ca 100644 --- a/node_modules/@capgo/capacitor-social-login/Package.swift +++ b/node_modules/@capgo/capacitor-social-login/Package.swift @@ -11,8 +11,6 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0"), - // FBSDKCoreKit and FBSDKLoginKit - .package(url: "https://github.com/facebook/facebook-ios-sdk.git", .upToNextMajor(from: "18.0.3")), // Add Google Sign-In dependency .package(url: "https://github.com/google/GoogleSignIn-iOS.git", .upToNextMajor(from: "9.0.0")), // Alamofire @@ -24,8 +22,6 @@ let package = Package( dependencies: [ .product(name: "Capacitor", package: "capacitor-swift-pm"), .product(name: "Cordova", package: "capacitor-swift-pm"), - .product(name: "FacebookCore", package: "facebook-ios-sdk"), - .product(name: "FacebookLogin", package: "facebook-ios-sdk"), .product(name: "GoogleSignIn", package: "GoogleSignIn-iOS"), .product(name: "Alamofire", package: "Alamofire") ], diff --git a/node_modules/@capgo/capacitor-social-login/android/src/main/java/ee/forgr/capacitor/social/login/GoogleProvider.java b/node_modules/@capgo/capacitor-social-login/android/src/main/java/ee/forgr/capacitor/social/login/GoogleProvider.java index f7b44ce..d6b95e3 100644 --- a/node_modules/@capgo/capacitor-social-login/android/src/main/java/ee/forgr/capacitor/social/login/GoogleProvider.java +++ b/node_modules/@capgo/capacitor-social-login/android/src/main/java/ee/forgr/capacitor/social/login/GoogleProvider.java @@ -204,9 +204,16 @@ public class GoogleProvider implements SocialProvider { } } - Log.i(SocialLoginPlugin.LOG_TAG, String.format("Google restoreState: %s", object)); + // JST (#706, 2026-10-02): this printed the whole saved object, the + // previous sign-in's Google ID token (the account's email address, + // name, profile-photo link and Google account id inside it) and + // access token, at INFO in every build type. It now says only + // that something was restored. See patches/. + Log.i(SocialLoginPlugin.LOG_TAG, "Google restoreState: saved sign-in restored (contents not logged)"); } catch (JSONException e) { - Log.e(SocialLoginPlugin.LOG_TAG, "Google restoreState: Failed to parse JSON", e); + // JST (#706): not the exception itself, whose message quotes the + // text it could not parse, which is the saved tokens. + Log.e(SocialLoginPlugin.LOG_TAG, "Google restoreState: Failed to parse JSON (" + e.getClass().getSimpleName() + ")"); } } @@ -910,7 +917,10 @@ public class GoogleProvider implements SocialProvider { private JSObject handleSignInResult(GetCredentialResponse result) throws JSONException { JSObject user = new JSObject(); - Log.d(LOG_TAG, "handleSignInResult: " + result.toString()); + // JST (#706, 2026-10-02): this appended result.toString(), the + // credential Google handed back, at DEBUG in every build type. Only + // that a result arrived is logged now. See patches/. + Log.d(LOG_TAG, "handleSignInResult: a credential arrived (contents not logged)"); Credential credential = result.getCredential(); if (credential instanceof CustomCredential) { @@ -946,7 +956,10 @@ public class GoogleProvider implements SocialProvider { throw new RuntimeException("No SUB field in the JWT"); } } catch (Exception e) { - Log.e(LOG_TAG, "Cannot get id from id_token", e); + // JST (#706): not the exception itself, whose message can + // quote the token's decoded payload (email address, name, + // profile-photo link, Google account id). + Log.e(LOG_TAG, "Cannot get id from id_token (" + e.getClass().getSimpleName() + ")"); } } } @@ -977,6 +990,17 @@ public class GoogleProvider implements SocialProvider { private void rawLogout(CredentialManagerCallback handler) { Log.i(LOG_TAG, "Logout requested"); + // JST (#706 fix pass, 2026-10-02): the saved sign-in goes FIRST, + // whatever Credential Manager answers. The plugin emptied it only in + // onResult below, so a clear that failed (Play services out of date, + // mid-update or disabled) left the Google ID token and access token + // on the phone after Log out and Delete Account. commit(), not + // apply(): this runs on Capacitor's plugin thread, never the main + // one, and an erase should not wait on a later disk write. The + // Credential Manager clear below stays, best-effort. See patches/. + context.getSharedPreferences(SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE).edit().clear().commit(); + GoogleProvider.this.accessToken = null; + GoogleProvider.this.idToken = null; clearCredentialManagerState( new CredentialManagerCallback() { @Override diff --git a/node_modules/@capgo/capacitor-social-login/ios/Sources/SocialLoginPlugin/AppleProvider.swift b/node_modules/@capgo/capacitor-social-login/ios/Sources/SocialLoginPlugin/AppleProvider.swift index 87e76b9..3a84bf7 100644 --- a/node_modules/@capgo/capacitor-social-login/ios/Sources/SocialLoginPlugin/AppleProvider.swift +++ b/node_modules/@capgo/capacitor-social-login/ios/Sources/SocialLoginPlugin/AppleProvider.swift @@ -146,16 +146,10 @@ class AppleProvider: NSObject, ASAuthorizationControllerDelegate, ASAuthorizatio // Convert the object to JSON data let jsonData = try JSONSerialization.data(withJSONObject: object, options: []) - // Convert JSON data to a string for logging - if let jsonString = String(data: jsonData, encoding: .utf8) { - // Log the object - print("Apple persistState: \(jsonString)") - - // Save the JSON string to UserDefaults or use your helper method - UserDefaults.standard.set(jsonString, forKey: SHARED_PREFERENCE_NAME) - } else { - print("Error converting JSON data to String") - } + // JST Fitness (#588): the tokens stay in memory. Upstream printed this + // JSON (the ID token, with the email address inside it) and saved it in + // UserDefaults, which a device backup carries. + _ = jsonData } func retrieveState() throws { @@ -191,7 +185,7 @@ class AppleProvider: NSObject, ASAuthorizationControllerDelegate, ASAuthorizatio self.accessToken = accessToken // Log the retrieved object - print("Apple retrieveState: \(object)") + print("Apple retrieveState: saved state restored (contents not logged)") } func login(payload: [String: Any], completion: @escaping (Result) -> Void) { @@ -286,7 +280,7 @@ class AppleProvider: NSObject, ASAuthorizationControllerDelegate, ASAuthorizatio if let decodedData = Data(base64Encoded: base64String, options: []), let payload = try? JSONSerialization.jsonObject(with: decodedData, options: []) as? [String: Any] { - print("payload", payload) + // JST Fitness (#588): upstream printed the decoded ID token here. decodedEmail = payload["email"] as? String ?? email } } @@ -377,14 +371,14 @@ class AppleProvider: NSObject, ASAuthorizationControllerDelegate, ASAuthorizatio // Check if the response is a redirect if (300...399).contains(httpResponse.statusCode) { if let location = httpResponse.headers.value(for: "Location") { - print("Redirect Location: \(location)") + print("Apple redirect: a location was returned (not logged)") // Parse the redirect URL if let redirectURL = URL(string: location), let urlComponents = URLComponents(url: redirectURL, resolvingAgainstBaseURL: false), let pathComponents = urlComponents.queryItems { - print("Query items: \(String(describing: urlComponents.queryItems))") + // JST Fitness (#588): upstream printed the redirect's query items here. // there are 4 main ways this can go: // 1. it provides the "code" and we fetch apple servers in order to get the JWT (yuck) @@ -479,7 +473,8 @@ class AppleProvider: NSObject, ASAuthorizationControllerDelegate, ASAuthorizatio // Handle non-redirect responses if let data = response.data, let responseString = String(data: data, encoding: .utf8) { - print("Response: \(responseString)") + print("Apple redirect: a response body was returned (not logged)") + _ = responseString } else { print("No response data received") } @@ -560,11 +555,8 @@ class AppleProvider: NSObject, ASAuthorizationControllerDelegate, ASAuthorizatio ) // Log the tokens (replace with your logging mechanism) - print("Apple Access Token is: \(accessToken)") - print("Expires in: \(expiresIn)") - print("Refresh token: \(refreshToken)") - print("ID Token: \(idToken)") - print("Apple User ID: \(userId)") + // JST Fitness (#588): upstream printed all five values here. + _ = expiresIn do { try self.persistState(idToken: idToken, refreshToken: refreshToken, accessToken: accessToken) @@ -582,7 +574,7 @@ class AppleProvider: NSObject, ASAuthorizationControllerDelegate, ASAuthorizatio } case .failure(let error): if let statusCode = response.response?.statusCode { - print("error", response.debugDescription) + print("Apple token exchange failed (details not logged)") completion(.failure(.invalidResponseCode(statusCode: statusCode))) } else { completion(.failure(.responseError(error))) @@ -602,14 +594,8 @@ class AppleProvider: NSObject, ASAuthorizationControllerDelegate, ASAuthorizatio } private func persistName(userId: String, givenName: String?, familyName: String?) { - if givenName == nil && familyName == nil { return } - - var names = UserDefaults.standard.dictionary(forKey: USER_INFO_KEY) as? [String: [String: String]] ?? [:] - names[userId] = [ - "givenName": givenName ?? "", - "familyName": familyName ?? "" - ] - UserDefaults.standard.set(names, forKey: USER_INFO_KEY) + // JST Fitness (#588): nothing is saved. Upstream kept every signed-in + // person's name in UserDefaults, keyed by their Apple user id, for good. } private func retrieveName(userId: String) -> (givenName: String?, familyName: String?)? {