react-native-authsignal 2.2.4 → 2.2.6

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.
@@ -147,7 +147,13 @@ class AuthsignalInAppModule(private val reactContext: ReactApplicationContext) :
147
147
 
148
148
  promise.reject(errorCode, response.error)
149
149
  } else {
150
- promise.resolve(response.data)
150
+ val data = response.data!!
151
+ val map = Arguments.createMap()
152
+ map.putString("credentialId", data.credentialId)
153
+ map.putString("createdAt", data.createdAt)
154
+ map.putString("userId", data.userId)
155
+ map.putString("lastAuthenticatedAt", data.lastAuthenticatedAt)
156
+ promise.resolve(map)
151
157
  }
152
158
  }
153
159
  }
@@ -44,7 +44,7 @@ class AuthsignalModule(private val reactContext: ReactApplicationContext) :
44
44
 
45
45
  @ReactMethod
46
46
  fun launch(url: String?, callback: Callback) {
47
- val activity = currentActivity
47
+ val activity = reactContext.currentActivity
48
48
  val parsedUrl = Uri.parse(url)
49
49
  this.callback = callback
50
50
 
@@ -178,8 +178,17 @@ class AuthsignalInAppModule: NSObject {
178
178
 
179
179
  if let error = response.error {
180
180
  reject(response.errorCode ?? "unexpected_error", error, nil)
181
+ } else if let data = response.data {
182
+ let credential: [String: String?] = [
183
+ "credentialId": data.credentialId,
184
+ "createdAt": data.createdAt,
185
+ "userId": data.userId,
186
+ "lastAuthenticatedAt": data.lastAuthenticatedAt,
187
+ ]
188
+
189
+ resolve(credential)
181
190
  } else {
182
- resolve(response.data)
191
+ resolve(nil)
183
192
  }
184
193
  }
185
194
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-authsignal",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
4
4
  "description": "The official Authsignal React Native library.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",