react-native-authsignal 2.2.5 → 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
  }
@@ -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.5",
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",