@capgo/capacitor-social-login 8.3.16 → 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.
@@ -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.16"
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] = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-social-login",
3
- "version": "8.3.16",
3
+ "version": "8.3.17",
4
4
  "description": "All social logins in one plugin",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",