@turnkey/sdk-react 4.0.0 → 4.1.1
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/CHANGELOG.md +58 -0
- package/dist/components/auth/Auth.d.ts +5 -0
- package/dist/components/auth/Auth.d.ts.map +1 -1
- package/dist/components/auth/Auth.js +22 -6
- package/dist/components/auth/Auth.js.map +1 -1
- package/dist/components/auth/Auth.mjs +23 -7
- package/dist/components/auth/Auth.mjs.map +1 -1
- package/package.json +5 -5
|
@@ -66,7 +66,8 @@ var Auth = function Auth(_ref) {
|
|
|
66
66
|
emailCustomization = _ref.emailCustomization,
|
|
67
67
|
sendFromEmailAddress = _ref.sendFromEmailAddress,
|
|
68
68
|
customSmsMessage = _ref.customSmsMessage,
|
|
69
|
-
customAccounts = _ref.customAccounts
|
|
69
|
+
customAccounts = _ref.customAccounts,
|
|
70
|
+
passkeyConfig = _ref.passkeyConfig;
|
|
70
71
|
var _useTurnkey = useTurnkey(),
|
|
71
72
|
authIframeClient = _useTurnkey.authIframeClient,
|
|
72
73
|
passkeyClient = _useTurnkey.passkeyClient,
|
|
@@ -175,7 +176,7 @@ var Auth = function Auth(_ref) {
|
|
|
175
176
|
};
|
|
176
177
|
var handleSignupWithPasskey = /*#__PURE__*/function () {
|
|
177
178
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
178
|
-
var siteInfo, _authConfig$sessionLe, _ref4, encodedChallenge, attestation, response;
|
|
179
|
+
var siteInfo, _authConfig$sessionLe, _passkeyConfig$name, _passkeyConfig$displa, _ref4, encodedChallenge, attestation, response;
|
|
179
180
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
180
181
|
while (1) switch (_context2.prev = _context2.next) {
|
|
181
182
|
case 0:
|
|
@@ -199,8 +200,8 @@ var Auth = function Auth(_ref) {
|
|
|
199
200
|
return passkeyClient === null || passkeyClient === void 0 ? void 0 : passkeyClient.createUserPasskey({
|
|
200
201
|
publicKey: {
|
|
201
202
|
user: {
|
|
202
|
-
name: siteInfo,
|
|
203
|
-
displayName: siteInfo
|
|
203
|
+
name: (_passkeyConfig$name = passkeyConfig === null || passkeyConfig === void 0 ? void 0 : passkeyConfig.name) !== null && _passkeyConfig$name !== void 0 ? _passkeyConfig$name : siteInfo,
|
|
204
|
+
displayName: (_passkeyConfig$displa = passkeyConfig === null || passkeyConfig === void 0 ? void 0 : passkeyConfig.displayName) !== null && _passkeyConfig$displa !== void 0 ? _passkeyConfig$displa : siteInfo
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
207
|
});
|
|
@@ -240,7 +241,12 @@ var Auth = function Auth(_ref) {
|
|
|
240
241
|
case 21:
|
|
241
242
|
case 22:
|
|
242
243
|
_context2.next = 24;
|
|
243
|
-
return passkeyClient === null || passkeyClient === void 0 ? void 0 : passkeyClient.loginWithPasskey(
|
|
244
|
+
return passkeyClient === null || passkeyClient === void 0 ? void 0 : passkeyClient.loginWithPasskey({
|
|
245
|
+
sessionType: SessionType.READ_WRITE,
|
|
246
|
+
iframeClient: authIframeClient,
|
|
247
|
+
targetPublicKey: authIframeClient === null || authIframeClient === void 0 ? void 0 : authIframeClient.iframePublicKey,
|
|
248
|
+
expirationSeconds: (_authConfig$sessionLe = authConfig.sessionLengthSeconds) === null || _authConfig$sessionLe === void 0 ? void 0 : _authConfig$sessionLe.toString()
|
|
249
|
+
});
|
|
244
250
|
case 24:
|
|
245
251
|
_context2.next = 26;
|
|
246
252
|
return onAuthSuccess();
|
|
@@ -271,7 +277,12 @@ var Auth = function Auth(_ref) {
|
|
|
271
277
|
_context3.prev = 0;
|
|
272
278
|
setLoading("passkey");
|
|
273
279
|
_context3.next = 4;
|
|
274
|
-
return passkeyClient === null || passkeyClient === void 0 ? void 0 : passkeyClient.loginWithPasskey(
|
|
280
|
+
return passkeyClient === null || passkeyClient === void 0 ? void 0 : passkeyClient.loginWithPasskey({
|
|
281
|
+
sessionType: SessionType.READ_WRITE,
|
|
282
|
+
iframeClient: authIframeClient,
|
|
283
|
+
targetPublicKey: authIframeClient === null || authIframeClient === void 0 ? void 0 : authIframeClient.iframePublicKey,
|
|
284
|
+
expirationSeconds: (_authConfig$sessionLe2 = authConfig.sessionLengthSeconds) === null || _authConfig$sessionLe2 === void 0 ? void 0 : _authConfig$sessionLe2.toString()
|
|
285
|
+
});
|
|
275
286
|
case 4:
|
|
276
287
|
_context3.next = 6;
|
|
277
288
|
return onAuthSuccess();
|
|
@@ -473,7 +484,12 @@ var Auth = function Auth(_ref) {
|
|
|
473
484
|
return _context6.abrupt("return");
|
|
474
485
|
case 17:
|
|
475
486
|
_context6.next = 19;
|
|
476
|
-
return walletClient.loginWithWallet(
|
|
487
|
+
return walletClient.loginWithWallet({
|
|
488
|
+
sessionType: SessionType.READ_WRITE,
|
|
489
|
+
iframeClient: authIframeClient,
|
|
490
|
+
targetPublicKey: authIframeClient === null || authIframeClient === void 0 ? void 0 : authIframeClient.iframePublicKey,
|
|
491
|
+
expirationSeconds: (_authConfig$sessionLe3 = authConfig.sessionLengthSeconds) === null || _authConfig$sessionLe3 === void 0 ? void 0 : _authConfig$sessionLe3.toString()
|
|
492
|
+
});
|
|
477
493
|
case 19:
|
|
478
494
|
_context6.next = 21;
|
|
479
495
|
return onAuthSuccess();
|