@capgo/capacitor-social-login 0.0.44 → 0.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -154,11 +154,13 @@ public class GoogleProvider implements SocialProvider {
154
154
  if (credential instanceof CustomCredential) {
155
155
  if (GoogleIdTokenCredential.TYPE_GOOGLE_ID_TOKEN_CREDENTIAL.equals(credential.getType())) {
156
156
  GoogleIdTokenCredential googleIdTokenCredential = GoogleIdTokenCredential.createFrom(credential.getData());
157
- resultObj.put("idToken", googleIdTokenCredential.getIdToken());
158
- persistState(googleIdTokenCredential.getIdToken());
157
+ String idToken = googleIdTokenCredential.getIdToken();
158
+ resultObj.put("idToken", idToken);
159
+ resultObj.put("accessToken", idToken); // Use idToken as accessToken
160
+ persistState(idToken);
159
161
  }
160
162
  }
161
-
163
+
162
164
  resultObj.put("profile", user);
163
165
  response.put("result", resultObj);
164
166
  Log.d(LOG_TAG, "Google Sign-In success: " + response.toString());
@@ -168,7 +168,12 @@ class AppleProvider: NSObject, ASAuthorizationControllerDelegate, ASAuthorizatio
168
168
 
169
169
  let appleIDProvider = ASAuthorizationAppleIDProvider()
170
170
  let request = appleIDProvider.createRequest()
171
- request.requestedScopes = [.fullName, .email]
171
+
172
+ if let scopes = payload["scopes"] as? [ASAuthorization.Scope] {
173
+ request.requestedScopes = scopes
174
+ } else {
175
+ request.requestedScopes = [.fullName, .email]
176
+ }
172
177
 
173
178
  let authorizationController = ASAuthorizationController(authorizationRequests: [request])
174
179
  authorizationController.delegate = self
@@ -205,7 +210,7 @@ class AppleProvider: NSObject, ASAuthorizationControllerDelegate, ASAuthorizatio
205
210
  case .authorized:
206
211
  // User is authorized, you might want to fetch more details here
207
212
  completion(.success(nil))
208
- case .revoked, .notFound:
213
+ case .revoked, .notFound, .transferred:
209
214
  completion(.success(nil))
210
215
  @unknown default:
211
216
  completion(.failure(NSError(domain: "AppleProvider", code: 0, userInfo: [NSLocalizedDescriptionKey: "Unknown credential state"])))
@@ -222,7 +227,7 @@ class AppleProvider: NSObject, ASAuthorizationControllerDelegate, ASAuthorizatio
222
227
 
223
228
  func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) {
224
229
  if let appleIDCredential = authorization.credential as? ASAuthorizationAppleIDCredential {
225
- let userIdentifier = appleIDCredential.user
230
+ let _ = appleIDCredential.user
226
231
  let fullName = appleIDCredential.fullName
227
232
  let email = appleIDCredential.email
228
233
 
@@ -311,7 +311,8 @@ public class SocialLoginPlugin: CAPPlugin, CAPBridgedPlugin {
311
311
  "provider": "facebook",
312
312
  "result": [
313
313
  "accessToken": facebookResponse.accessToken,
314
- "profile": facebookResponse.profile
314
+ "profile": facebookResponse.profile,
315
+ "authenticationToken": facebookResponse.authenticationToken ?? ""
315
316
  ]
316
317
  ])
317
318
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-social-login",
3
- "version": "0.0.44",
3
+ "version": "0.0.46",
4
4
  "description": "All social logins in one plugin",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -51,22 +51,22 @@
51
51
  "@capacitor/android": "^6.0.0",
52
52
  "@capacitor/cli": "^6.0.0",
53
53
  "@capacitor/core": "^6.0.0",
54
- "@capacitor/docgen": "^0.2.2",
54
+ "@capacitor/docgen": "^0.3.0",
55
55
  "@capacitor/ios": "^6.0.0",
56
56
  "@ionic/eslint-config": "^0.4.0",
57
57
  "@ionic/prettier-config": "^4.0.0",
58
58
  "@ionic/swiftlint-config": "^2.0.0",
59
59
  "@types/node": "^20.12.12",
60
- "@typescript-eslint/eslint-plugin": "^8.7.0",
61
- "@typescript-eslint/parser": "^8.7.0",
60
+ "@typescript-eslint/eslint-plugin": "^8.11.0",
61
+ "@typescript-eslint/parser": "^8.11.0",
62
62
  "eslint": "^8.57.1",
63
- "eslint-plugin-import": "^2.30.0",
63
+ "eslint-plugin-import": "^2.31.0",
64
64
  "prettier": "^3.3.3",
65
65
  "prettier-plugin-java": "^2.6.4",
66
66
  "rimraf": "^6.0.1",
67
- "rollup": "^4.22.4",
67
+ "rollup": "^4.24.0",
68
68
  "swiftlint": "^2.0.0",
69
- "typescript": "^5.4.5"
69
+ "typescript": "^5.6.3"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "@capacitor/core": "^6.0.0"
@@ -83,5 +83,5 @@
83
83
  "src": "android"
84
84
  }
85
85
  },
86
- "packageManager": "pnpm@9.9.0+sha512.60c18acd138bff695d339be6ad13f7e936eea6745660d4cc4a776d5247c540d0edee1a563695c183a66eb917ef88f2b4feb1fc25f32a7adcadc7aaf3438e99c1"
86
+ "packageManager": "pnpm@9.12.2+sha512.22721b3a11f81661ae1ec68ce1a7b879425a1ca5b991c975b074ac220b187ce56c708fe5db69f4c962c989452eee76c82877f4ee80f474cebd61ee13461b6228"
87
87
  }