react-native-authsignal 2.2.5 → 2.2.7
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
|
-
|
|
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
|
}
|
|
@@ -166,7 +172,12 @@ class AuthsignalInAppModule(private val reactContext: ReactApplicationContext) :
|
|
|
166
172
|
|
|
167
173
|
promise.reject(errorCode, response.error)
|
|
168
174
|
} else {
|
|
169
|
-
|
|
175
|
+
val data = response.data!!
|
|
176
|
+
val map = Arguments.createMap()
|
|
177
|
+
map.putBoolean("isVerified", data.isVerified)
|
|
178
|
+
map.putString("token", data.token)
|
|
179
|
+
map.putString("userId", data.userId)
|
|
180
|
+
promise.resolve(map)
|
|
170
181
|
}
|
|
171
182
|
}
|
|
172
183
|
}
|
|
@@ -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(
|
|
191
|
+
resolve(nil)
|
|
183
192
|
}
|
|
184
193
|
}
|
|
185
194
|
}
|
|
@@ -210,7 +219,13 @@ class AuthsignalInAppModule: NSObject {
|
|
|
210
219
|
if let error = response.error {
|
|
211
220
|
reject(response.errorCode ?? "unexpected_error", error, nil)
|
|
212
221
|
} else {
|
|
213
|
-
|
|
222
|
+
let verifyPinResponse: [String: Any?] = [
|
|
223
|
+
"isVerified": response.data!.isVerified,
|
|
224
|
+
"token": response.data!.token,
|
|
225
|
+
"userId": response.data!.userId,
|
|
226
|
+
]
|
|
227
|
+
|
|
228
|
+
resolve(verifyPinResponse)
|
|
214
229
|
}
|
|
215
230
|
}
|
|
216
231
|
}
|