react-native-nitro-auth 0.1.1 → 0.1.2

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/app.plugin.js CHANGED
@@ -14,6 +14,9 @@ const withNitroAuth = (config, props = {}) => {
14
14
  if (ios.googleClientId) {
15
15
  config.modResults.GIDClientID = ios.googleClientId;
16
16
  }
17
+ if (ios.googleServerClientId) {
18
+ config.modResults.GIDServerClientID = ios.googleServerClientId;
19
+ }
17
20
  if (ios.googleUrlScheme) {
18
21
  const existingSchemes = config.modResults.CFBundleURLTypes || [];
19
22
  if (
@@ -60,5 +63,5 @@ const withNitroAuth = (config, props = {}) => {
60
63
  module.exports = createRunOncePlugin(
61
64
  withNitroAuth,
62
65
  "react-native-nitro-auth",
63
- "0.1.0"
66
+ "0.1.2"
64
67
  );
@@ -14,6 +14,8 @@ public class AuthAdapter: NSObject {
14
14
  return
15
15
  }
16
16
 
17
+ let serverClientId = Bundle.main.object(forInfoDictionaryKey: "GIDServerClientID") as? String
18
+
17
19
  DispatchQueue.main.async {
18
20
  guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
19
21
  let rootVC = windowScene.windows.first?.rootViewController else {
@@ -21,6 +23,9 @@ public class AuthAdapter: NSObject {
21
23
  return
22
24
  }
23
25
 
26
+ let config = GIDConfiguration(clientID: clientId, serverClientID: serverClientId)
27
+ GIDSignIn.sharedInstance.configuration = config
28
+
24
29
  let additionalScopes = scopes.isEmpty ? nil : scopes
25
30
  GIDSignIn.sharedInstance.signIn(withPresenting: rootVC, hint: loginHint, additionalScopes: additionalScopes) { result, error in
26
31
  if let error = error {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-nitro-auth",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "High-performance authentication library for React Native with Google Sign-In and Apple Sign-In support, powered by Nitro Modules (JSI)",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",