@capgo/capacitor-social-login 8.3.15 → 8.3.17
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 +5 -1
- package/android/src/main/java/ee/forgr/capacitor/social/login/GoogleProvider.java +4 -1
- package/android/src/main/java/ee/forgr/capacitor/social/login/SocialLoginPlugin.java +1 -1
- package/dist/docs.json +2 -2
- package/dist/esm/definitions.d.ts +10 -2
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/google-provider.js +6 -2
- package/dist/esm/google-provider.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/social-login.d.ts +64 -1
- package/dist/esm/social-login.js +63 -1
- package/dist/esm/social-login.js.map +1 -1
- package/dist/plugin.cjs.js +71 -4
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +71 -4
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/SocialLoginPlugin/GoogleProvider.swift +6 -0
- package/ios/Sources/SocialLoginPlugin/SocialLoginPlugin.swift +1 -1
- package/package.json +1 -1
|
@@ -16,6 +16,7 @@ class GoogleProvider {
|
|
|
16
16
|
var additionalScopes: [String]!
|
|
17
17
|
var defaultGrantedScopes = ["email", "profile", "openid"]
|
|
18
18
|
var mode = GoogleProviderLoginType.ONLINE
|
|
19
|
+
private let offlineRefreshNotSupportedMessage = "Google refresh() is not available when using offline mode. Offline mode only returns serverAuthCode for backend token exchange. Send serverAuthCode to your backend and refresh tokens there, or switch google.mode to 'online' for client-side refresh."
|
|
19
20
|
|
|
20
21
|
func initialize(clientId: String, mode: GoogleProviderLoginType, serverClientId: String? = nil, hostedDomain: String? = nil) {
|
|
21
22
|
configuration = GIDConfiguration(clientID: clientId, serverClientID: serverClientId, hostedDomain: hostedDomain, openIDRealm: nil)
|
|
@@ -194,6 +195,11 @@ class GoogleProvider {
|
|
|
194
195
|
}
|
|
195
196
|
|
|
196
197
|
func refresh(completion: @escaping (Result<Void, Error>) -> Void) {
|
|
198
|
+
if self.mode == .OFFLINE {
|
|
199
|
+
print("[GoogleProvider] \(offlineRefreshNotSupportedMessage)")
|
|
200
|
+
completion(.failure(NSError(domain: "GoogleProvider", code: 0, userInfo: [NSLocalizedDescriptionKey: offlineRefreshNotSupportedMessage])))
|
|
201
|
+
return
|
|
202
|
+
}
|
|
197
203
|
DispatchQueue.main.async {
|
|
198
204
|
guard let currentUser = GIDSignIn.sharedInstance.currentUser else {
|
|
199
205
|
completion(.failure(NSError(domain: "GoogleProvider", code: 0, userInfo: [NSLocalizedDescriptionKey: "User not logged in"])))
|
|
@@ -16,7 +16,7 @@ import GoogleSignIn
|
|
|
16
16
|
*/
|
|
17
17
|
@objc(SocialLoginPlugin)
|
|
18
18
|
public class SocialLoginPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
19
|
-
private let pluginVersion: String = "8.3.
|
|
19
|
+
private let pluginVersion: String = "8.3.17"
|
|
20
20
|
public let identifier = "SocialLoginPlugin"
|
|
21
21
|
public let jsName = "SocialLogin"
|
|
22
22
|
public let pluginMethods: [CAPPluginMethod] = [
|