@capgo/capacitor-social-login 0.0.76 → 0.0.77-alpha.0
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.
- package/README.md +34 -19
- package/android/build.gradle +1 -0
- package/android/src/main/java/ee/forgr/capacitor/social/login/AppleProvider.java +9 -10
- package/android/src/main/java/ee/forgr/capacitor/social/login/GoogleProvider.java +639 -76
- package/android/src/main/java/ee/forgr/capacitor/social/login/ModifiedMainActivityForSocialLoginPlugin.java +5 -0
- package/android/src/main/java/ee/forgr/capacitor/social/login/SocialLoginPlugin.java +33 -1
- package/dist/docs.json +71 -10
- package/dist/esm/definitions.d.ts +24 -8
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +8 -1
- package/dist/esm/web.js +244 -45
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +244 -45
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +244 -45
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/SocialLoginPlugin/GoogleProvider.swift +72 -14
- package/ios/Sources/SocialLoginPlugin/SocialLoginPlugin.swift +30 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -341,11 +341,11 @@ Refresh the access token
|
|
|
341
341
|
|
|
342
342
|
#### InitializeOptions
|
|
343
343
|
|
|
344
|
-
| Prop | Type
|
|
345
|
-
| -------------- |
|
|
346
|
-
| **`facebook`** | <code>{ appId: string; clientToken: string; }</code>
|
|
347
|
-
| **`google`** | <code>{ iOSClientId?: string; iOSServerClientId?: string; webClientId?: string; }</code> |
|
|
348
|
-
| **`apple`** | <code>{ clientId?: string; redirectUrl?: string; }</code>
|
|
344
|
+
| Prop | Type |
|
|
345
|
+
| -------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
346
|
+
| **`facebook`** | <code>{ appId: string; clientToken: string; }</code> |
|
|
347
|
+
| **`google`** | <code>{ iOSClientId?: string; iOSServerClientId?: string; webClientId?: string; mode?: 'online' \| 'offline'; }</code> |
|
|
348
|
+
| **`apple`** | <code>{ clientId?: string; redirectUrl?: string; }</code> |
|
|
349
349
|
|
|
350
350
|
|
|
351
351
|
#### FacebookLoginResponse
|
|
@@ -372,13 +372,22 @@ Refresh the access token
|
|
|
372
372
|
| **`userId`** | <code>string</code> |
|
|
373
373
|
|
|
374
374
|
|
|
375
|
-
####
|
|
375
|
+
#### GoogleLoginResponseOnline
|
|
376
|
+
|
|
377
|
+
| Prop | Type |
|
|
378
|
+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
379
|
+
| **`accessToken`** | <code><a href="#accesstoken">AccessToken</a> \| null</code> |
|
|
380
|
+
| **`idToken`** | <code>string \| null</code> |
|
|
381
|
+
| **`profile`** | <code>{ email: string \| null; familyName: string \| null; givenName: string \| null; id: string \| null; name: string \| null; imageUrl: string \| null; }</code> |
|
|
382
|
+
| **`responseType`** | <code>'online'</code> |
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
#### GoogleLoginResponseOffline
|
|
376
386
|
|
|
377
|
-
| Prop
|
|
378
|
-
|
|
|
379
|
-
| **`
|
|
380
|
-
| **`
|
|
381
|
-
| **`profile`** | <code>{ email: string \| null; familyName: string \| null; givenName: string \| null; id: string \| null; name: string \| null; imageUrl: string \| null; }</code> |
|
|
387
|
+
| Prop | Type |
|
|
388
|
+
| -------------------- | ---------------------- |
|
|
389
|
+
| **`serverAuthCode`** | <code>string</code> |
|
|
390
|
+
| **`responseType`** | <code>'offline'</code> |
|
|
382
391
|
|
|
383
392
|
|
|
384
393
|
#### AppleProviderResponse
|
|
@@ -401,11 +410,11 @@ Refresh the access token
|
|
|
401
410
|
|
|
402
411
|
#### GoogleLoginOptions
|
|
403
412
|
|
|
404
|
-
| Prop
|
|
405
|
-
|
|
|
406
|
-
| **`scopes`**
|
|
407
|
-
| **`nonce`**
|
|
408
|
-
| **`
|
|
413
|
+
| Prop | Type | Description | Default |
|
|
414
|
+
| ----------------------- | --------------------- | ---------------------------------------------------------------------------------------------------- | ------------------ |
|
|
415
|
+
| **`scopes`** | <code>string[]</code> | Specifies the scopes required for accessing Google APIs The default is defined in the configuration. | |
|
|
416
|
+
| **`nonce`** | <code>string</code> | Nonce | |
|
|
417
|
+
| **`forceRefreshToken`** | <code>boolean</code> | Force refresh token (only for Android) | <code>false</code> |
|
|
409
418
|
|
|
410
419
|
|
|
411
420
|
#### AppleProviderOptions
|
|
@@ -426,9 +435,10 @@ Refresh the access token
|
|
|
426
435
|
|
|
427
436
|
#### AuthorizationCode
|
|
428
437
|
|
|
429
|
-
| Prop
|
|
430
|
-
|
|
|
431
|
-
| **`jwt`**
|
|
438
|
+
| Prop | Type | Description |
|
|
439
|
+
| ----------------- | ------------------- | ------------ |
|
|
440
|
+
| **`jwt`** | <code>string</code> | Jwt |
|
|
441
|
+
| **`accessToken`** | <code>string</code> | Access Token |
|
|
432
442
|
|
|
433
443
|
|
|
434
444
|
#### AuthorizationCodeOptions
|
|
@@ -446,6 +456,11 @@ Refresh the access token
|
|
|
446
456
|
<code>{ facebook: <a href="#facebookloginresponse">FacebookLoginResponse</a>; google: <a href="#googleloginresponse">GoogleLoginResponse</a>; apple: <a href="#appleproviderresponse">AppleProviderResponse</a>; }</code>
|
|
447
457
|
|
|
448
458
|
|
|
459
|
+
#### GoogleLoginResponse
|
|
460
|
+
|
|
461
|
+
<code><a href="#googleloginresponseonline">GoogleLoginResponseOnline</a> | <a href="#googleloginresponseoffline">GoogleLoginResponseOffline</a></code>
|
|
462
|
+
|
|
463
|
+
|
|
449
464
|
#### LoginOptions
|
|
450
465
|
|
|
451
466
|
<code>{ provider: "facebook"; options: <a href="#facebookloginoptions">FacebookLoginOptions</a>; } | { provider: "google"; options: <a href="#googleloginoptions">GoogleLoginOptions</a>; } | { provider: "apple"; options: <a href="#appleprovideroptions">AppleProviderOptions</a>; }</code>
|
package/android/build.gradle
CHANGED
|
@@ -63,4 +63,5 @@ dependencies {
|
|
|
63
63
|
testImplementation "junit:junit:$junitVersion"
|
|
64
64
|
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
65
65
|
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
66
|
+
implementation 'androidx.concurrent:concurrent-futures:1.2.0'
|
|
66
67
|
}
|
|
@@ -189,16 +189,15 @@ public class AppleProvider implements SocialProvider {
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
this.appleAuthURLFull =
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
state;
|
|
192
|
+
this.appleAuthURLFull = AUTHURL +
|
|
193
|
+
"?client_id=" +
|
|
194
|
+
this.clientId +
|
|
195
|
+
"&redirect_uri=" +
|
|
196
|
+
this.redirectUrl +
|
|
197
|
+
"&response_type=code&scope=" +
|
|
198
|
+
scopes +
|
|
199
|
+
"&response_mode=form_post&state=" +
|
|
200
|
+
state;
|
|
202
201
|
|
|
203
202
|
if (nonce != null) {
|
|
204
203
|
this.appleAuthURLFull += "&nonce=" + nonce;
|