@stytch/vanilla-js 4.5.5 → 4.6.0
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 +11 -0
- package/dist/b2b/index.esm.js +5724 -4136
- package/dist/b2b/index.headless.esm.js +735 -603
- package/dist/b2b/index.headless.js +717 -587
- package/dist/b2b/index.js +5049 -3463
- package/dist/index.esm.js +3927 -3812
- package/dist/index.headless.esm.js +670 -667
- package/dist/index.headless.js +647 -646
- package/dist/index.js +3837 -3724
- package/package.json +5 -3
package/dist/index.headless.js
CHANGED
|
@@ -137,25 +137,26 @@ function d(e) {
|
|
|
137
137
|
var h, p, f, _, m, v;
|
|
138
138
|
Object.defineProperty(exports, "__esModule", {
|
|
139
139
|
value: !0
|
|
140
|
-
}), exports.Products = void 0, (h = exports.Products || (exports.Products = {})).emailMagicLinks = "emailMagicLinks", h.oauth = "oauth", h.otp = "otp", h.crypto = "crypto", h.passwords = "passwords", h.passkeys = "passkeys", exports.OAuthProviders = void 0, (p = exports.OAuthProviders || (exports.OAuthProviders = {})).Google = "google", p.Microsoft = "microsoft", p.Apple = "apple", p.Github = "github", p.GitLab = "gitlab", p.Facebook = "facebook", p.Discord = "discord", p.Salesforce = "salesforce", p.Slack = "slack", p.Amazon = "amazon", p.Bitbucket = "bitbucket", p.LinkedIn = "linkedin", p.Coinbase = "coinbase", p.Twitch = "twitch", p.Twitter = "twitter", p.TikTok = "tiktok", p.Snapchat = "snapchat", p.Figma = "figma", p.Yahoo = "yahoo", exports.Wallets = void 0, (f = exports.Wallets || (exports.Wallets = {})).Vessel = "Vessel", f.Phantom = "Phantom", f.Metamask = "Metamask", f.Coinbase = "Coinbase", f.Binance = "Binance", f.GenericEthereumWallet = "Other Ethereum Wallet", f.GenericSolanaWallet = "Other Solana Wallet", exports.OneTapPositions = void 0, (_ = exports.OneTapPositions || (exports.OneTapPositions = {})).embedded = "embedded", _.floating = "floating", exports.OTPMethods = void 0, (m = exports.OTPMethods || (exports.OTPMethods = {})).SMS = "sms", m.WhatsApp = "whatsapp", m.Email = "email", exports.StytchEventType = void 0, (v = exports.StytchEventType || (exports.StytchEventType = {})).MagicLinkLoginOrCreateEvent = "MAGIC_LINK_LOGIN_OR_CREATE", v.OTPsLoginOrCreateEvent = "OTP_LOGIN_OR_CREATE", v.OTPsAuthenticate = "OTP_AUTHENTICATE", v.CryptoWalletAuthenticateStart = "CRYPTO_WALLET_AUTHENTICATE_START", v.CryptoWalletAuthenticate = "CRYPTO_WALLET_AUTHENTICATE", v.PasswordCreate = "PASSWORD_CREATE", v.PasswordAuthenticate = "PASSWORD_AUTHENTICATE", v.PasswordResetByEmailStart = "PASSWORD_RESET_BY_EMAIL_START", v.PasswordResetByEmail = "PASSWORD_RESET_BY_EMAIL", v.PasskeyRegister = "PASSKEY_REGISTER", v.PasskeyAuthenticate = "PASSKEY_AUTHENTICATE", v.PasskeySkip = "PASSKEY_SKIP", v.PasskeyDone = "PASSKEY_DONE", v.B2BMagicLinkEmailLoginOrSignup = "B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP", v.B2BMagicLinkAuthenticate = "B2B_MAGIC_LINK_AUTHENTICATE", v.B2BMagicLinkEmailDiscoverySend = "B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND", v.B2BMagicLinkDiscoveryAuthenticate = "B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE", v.B2BSSOStart = "B2B_SSO_START", v.B2BSSOAuthenticate = "B2B_SSO_AUTHENTICATE", v.B2BOAuthAuthenticate = "B2B_OAUTH_AUTHENTICATE", v.B2BOAuthDiscoveryAuthenticate = "B2B_OAUTH_DISCOVERY_AUTHENTICATE", v.B2BDiscoveryOrganizationsCreate = "B2B_DISCOVERY_ORGANIZATIONS_CREATE", v.B2BDiscoveryIntermediateSessionExchange = "B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE", v.B2BPasswordAuthenticate = "B2B_PASSWORD_AUTHENTICATE", v.B2BPasswordResetByEmailStart = "B2B_PASSWORD_RESET_BY_EMAIL_START", v.B2BPasswordResetByEmail = "B2B_PASSWORD_RESET_BY_EMAIL", v.B2BPasswordResetBySession = "B2B_PASSWORD_RESET_BY_SESSION";
|
|
140
|
+
}), exports.Products = void 0, (h = exports.Products || (exports.Products = {})).emailMagicLinks = "emailMagicLinks", h.oauth = "oauth", h.otp = "otp", h.crypto = "crypto", h.passwords = "passwords", h.passkeys = "passkeys", exports.OAuthProviders = void 0, (p = exports.OAuthProviders || (exports.OAuthProviders = {})).Google = "google", p.Microsoft = "microsoft", p.Apple = "apple", p.Github = "github", p.GitLab = "gitlab", p.Facebook = "facebook", p.Discord = "discord", p.Salesforce = "salesforce", p.Slack = "slack", p.Amazon = "amazon", p.Bitbucket = "bitbucket", p.LinkedIn = "linkedin", p.Coinbase = "coinbase", p.Twitch = "twitch", p.Twitter = "twitter", p.TikTok = "tiktok", p.Snapchat = "snapchat", p.Figma = "figma", p.Yahoo = "yahoo", exports.Wallets = void 0, (f = exports.Wallets || (exports.Wallets = {})).Vessel = "Vessel", f.Phantom = "Phantom", f.Metamask = "Metamask", f.Coinbase = "Coinbase", f.Binance = "Binance", f.GenericEthereumWallet = "Other Ethereum Wallet", f.GenericSolanaWallet = "Other Solana Wallet", exports.OneTapPositions = void 0, (_ = exports.OneTapPositions || (exports.OneTapPositions = {})).embedded = "embedded", _.floating = "floating", exports.OTPMethods = void 0, (m = exports.OTPMethods || (exports.OTPMethods = {})).SMS = "sms", m.WhatsApp = "whatsapp", m.Email = "email", exports.StytchEventType = void 0, (v = exports.StytchEventType || (exports.StytchEventType = {})).MagicLinkLoginOrCreateEvent = "MAGIC_LINK_LOGIN_OR_CREATE", v.OTPsLoginOrCreateEvent = "OTP_LOGIN_OR_CREATE", v.OTPsAuthenticate = "OTP_AUTHENTICATE", v.CryptoWalletAuthenticateStart = "CRYPTO_WALLET_AUTHENTICATE_START", v.CryptoWalletAuthenticate = "CRYPTO_WALLET_AUTHENTICATE", v.PasswordCreate = "PASSWORD_CREATE", v.PasswordAuthenticate = "PASSWORD_AUTHENTICATE", v.PasswordResetByEmailStart = "PASSWORD_RESET_BY_EMAIL_START", v.PasswordResetByEmail = "PASSWORD_RESET_BY_EMAIL", v.PasskeyRegister = "PASSKEY_REGISTER", v.PasskeyAuthenticate = "PASSKEY_AUTHENTICATE", v.PasskeySkip = "PASSKEY_SKIP", v.PasskeyDone = "PASSKEY_DONE", v.B2BMagicLinkEmailLoginOrSignup = "B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP", v.B2BMagicLinkAuthenticate = "B2B_MAGIC_LINK_AUTHENTICATE", v.B2BMagicLinkEmailDiscoverySend = "B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND", v.B2BMagicLinkDiscoveryAuthenticate = "B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE", v.B2BSSOStart = "B2B_SSO_START", v.B2BSSOAuthenticate = "B2B_SSO_AUTHENTICATE", v.B2BOAuthAuthenticate = "B2B_OAUTH_AUTHENTICATE", v.B2BOAuthDiscoveryAuthenticate = "B2B_OAUTH_DISCOVERY_AUTHENTICATE", v.B2BDiscoveryOrganizationsCreate = "B2B_DISCOVERY_ORGANIZATIONS_CREATE", v.B2BDiscoveryIntermediateSessionExchange = "B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE", v.B2BPasswordAuthenticate = "B2B_PASSWORD_AUTHENTICATE", v.B2BPasswordResetByEmailStart = "B2B_PASSWORD_RESET_BY_EMAIL_START", v.B2BPasswordResetByEmail = "B2B_PASSWORD_RESET_BY_EMAIL", v.B2BPasswordResetBySession = "B2B_PASSWORD_RESET_BY_SESSION", v.B2BSMSOTPSend = "B2B_SMS_OTP_SEND", v.B2BSMSOTPAuthenticate = "B2B_SMS_OTP_AUTHENTICATE", v.B2BTOTPCreate = "B2B_TOTP_CREATE", v.B2BTOTPAuthenticate = "B2B_TOTP_AUTHENTICATE", v.B2BRecoveryCodesRecover = "B2B_RECOVERY_CODES_RECOVER";
|
|
141
141
|
var y,
|
|
142
142
|
g,
|
|
143
143
|
b,
|
|
144
|
-
k
|
|
144
|
+
k,
|
|
145
|
+
w = function (e) {
|
|
145
146
|
function t(e, r) {
|
|
146
147
|
var n;
|
|
147
148
|
return i(this, t), (n = s(this, t, [e + "\n" + r])).message = e + "\n" + r, n.name = "SDKAPIUnreachableError", n.details = r, Object.setPrototypeOf(o(n), t.prototype), n;
|
|
148
149
|
}
|
|
149
150
|
return a(t, c(Error)), r(t);
|
|
150
151
|
}(),
|
|
151
|
-
|
|
152
|
+
S = function (e) {
|
|
152
153
|
function t(e, r) {
|
|
153
154
|
var n;
|
|
154
155
|
return i(this, t), (n = s(this, t)).name = "StytchSDKUsageError", n.message = "Invalid call to ".concat(e, "\n") + r, n;
|
|
155
156
|
}
|
|
156
157
|
return a(t, c(Error)), r(t);
|
|
157
158
|
}(),
|
|
158
|
-
|
|
159
|
+
x = function (e) {
|
|
159
160
|
function t(e) {
|
|
160
161
|
var r, n;
|
|
161
162
|
i(this, t), (r = s(this, t)).name = "StytchSDKSchemaError";
|
|
@@ -166,7 +167,7 @@ var y,
|
|
|
166
167
|
}
|
|
167
168
|
return a(t, c(Error)), r(t);
|
|
168
169
|
}(),
|
|
169
|
-
|
|
170
|
+
P = function (e) {
|
|
170
171
|
function t(e) {
|
|
171
172
|
var r;
|
|
172
173
|
i(this, t), (r = s(this, t)).name = "StytchSDKAPIError";
|
|
@@ -180,19 +181,19 @@ var y,
|
|
|
180
181
|
return a(t, c(Error)), r(t);
|
|
181
182
|
}(),
|
|
182
183
|
C = ["unauthorized_credentials", "user_unauthenticated", "invalid_secret_authentication", "session_not_found"],
|
|
183
|
-
|
|
184
|
+
O = function (e) {
|
|
184
185
|
function t(e, r) {
|
|
185
186
|
var n;
|
|
186
187
|
return i(this, t), (n = s(this, t, [r])).name = e, n;
|
|
187
188
|
}
|
|
188
189
|
return a(t, c(Error)), r(t);
|
|
189
190
|
}(),
|
|
190
|
-
|
|
191
|
+
T = function (e) {
|
|
191
192
|
function t(e) {
|
|
192
193
|
var r;
|
|
193
194
|
return i(this, t), r = s(this, t, ["StytchAPIUnreachableError", e]), Object.setPrototypeOf(o(r), t.prototype), r;
|
|
194
195
|
}
|
|
195
|
-
return a(t,
|
|
196
|
+
return a(t, O), r(t);
|
|
196
197
|
}(),
|
|
197
198
|
A = function (e) {
|
|
198
199
|
function t(e) {
|
|
@@ -203,9 +204,9 @@ var y,
|
|
|
203
204
|
}).join("\n");
|
|
204
205
|
return s(this, t, ["StytchAPISchemaError", "Request does not match expected schema\n".concat(n)]);
|
|
205
206
|
}
|
|
206
|
-
return a(t,
|
|
207
|
+
return a(t, O), r(t);
|
|
207
208
|
}(),
|
|
208
|
-
|
|
209
|
+
E = function (e) {
|
|
209
210
|
function t(e) {
|
|
210
211
|
var r;
|
|
211
212
|
i(this, t);
|
|
@@ -216,193 +217,193 @@ var y,
|
|
|
216
217
|
u = e.request_id;
|
|
217
218
|
return (r = s(this, t, ["StytchAPIError", "[".concat(n, "] ").concat(o, "\n") + "".concat(a, "\n") + "See ".concat(c, " for more information.\n") + (u ? "request_id: ".concat(u, "\n") : "")])).error_type = o, r.error_message = a, r.error_url = c, r.request_id = u, r.status_code = n, r;
|
|
218
219
|
}
|
|
219
|
-
return a(t,
|
|
220
|
+
return a(t, O), r(t);
|
|
220
221
|
}(),
|
|
221
|
-
|
|
222
|
+
D = function (e) {
|
|
222
223
|
function t(e, r, n) {
|
|
223
224
|
var o;
|
|
224
225
|
return i(this, t), (o = s(this, t, [e, r])).options = n, o;
|
|
225
226
|
}
|
|
226
|
-
return a(t,
|
|
227
|
+
return a(t, O), r(t);
|
|
227
228
|
}(),
|
|
228
|
-
|
|
229
|
+
R = function (e) {
|
|
229
230
|
function t() {
|
|
230
231
|
return i(this, t), s(this, t, ["NoCurrentSessionError", "There is no session currently available. Make sure the user is authenticated with a valid session."]);
|
|
231
232
|
}
|
|
232
|
-
return a(t,
|
|
233
|
+
return a(t, D), r(t);
|
|
233
234
|
}(),
|
|
234
|
-
|
|
235
|
+
I = function (e) {
|
|
235
236
|
function t(e) {
|
|
236
237
|
return i(this, t), s(this, t, ["InternalError", e || "An internal error has occurred. Please contact Stytch if this occurs."]);
|
|
237
238
|
}
|
|
238
|
-
return a(t,
|
|
239
|
+
return a(t, D), r(t);
|
|
239
240
|
}(),
|
|
240
|
-
|
|
241
|
+
F = function (e) {
|
|
241
242
|
function t() {
|
|
242
243
|
return i(this, t), s(this, t, ["NoBiometricsRegistrationError", "There is no biometric registration available. Authenticate with another method and add a new biometric registration first."]);
|
|
243
244
|
}
|
|
244
|
-
return a(t,
|
|
245
|
+
return a(t, D), r(t);
|
|
245
246
|
}(),
|
|
246
|
-
|
|
247
|
+
j = function (e) {
|
|
247
248
|
function t() {
|
|
248
249
|
return i(this, t), s(this, t, ["BiometricsUnavailableError", "Biometrics is not available on the device."]);
|
|
249
250
|
}
|
|
250
|
-
return a(t,
|
|
251
|
+
return a(t, D), r(t);
|
|
251
252
|
}(),
|
|
252
|
-
|
|
253
|
+
B = function (e) {
|
|
253
254
|
function t() {
|
|
254
255
|
return i(this, t), s(this, t, ["KeyInvalidatedError", "The biometrics enrollment on the device has changed."]);
|
|
255
256
|
}
|
|
256
|
-
return a(t,
|
|
257
|
+
return a(t, D), r(t);
|
|
257
258
|
}(),
|
|
258
259
|
L = function (e) {
|
|
259
260
|
function t() {
|
|
260
261
|
return i(this, t), s(this, t, ["KeystoreUnavailableError", "The Android keystore is unavailable on the device. Consider setting allowFallbackToCleartext to true."]);
|
|
261
262
|
}
|
|
262
|
-
return a(t,
|
|
263
|
+
return a(t, D), r(t);
|
|
263
264
|
}(),
|
|
264
|
-
|
|
265
|
+
M = function (e) {
|
|
265
266
|
function t() {
|
|
266
267
|
return i(this, t), s(this, t, ["NoBiometricsEnrolledError", "There is no biometric factor enrolled on the device. Add a biometric factor in the device settings."]);
|
|
267
268
|
}
|
|
268
|
-
return a(t,
|
|
269
|
+
return a(t, D), r(t);
|
|
269
270
|
}(),
|
|
270
|
-
|
|
271
|
+
U = function (e) {
|
|
271
272
|
function t() {
|
|
272
273
|
return i(this, t), s(this, t, ["UserCancellationError", "The user canceled the prompt. Ask the user to try again."]);
|
|
273
274
|
}
|
|
274
|
-
return a(t,
|
|
275
|
+
return a(t, D), r(t);
|
|
275
276
|
}(),
|
|
276
|
-
|
|
277
|
+
N = function (e) {
|
|
277
278
|
function t() {
|
|
278
279
|
return i(this, t), s(this, t, ["UserLockedOutError", "The user has been locked out due to too many failed attempts. Ask the user to try again later."]);
|
|
279
280
|
}
|
|
280
|
-
return a(t,
|
|
281
|
+
return a(t, D), r(t);
|
|
281
282
|
}(),
|
|
282
|
-
|
|
283
|
+
K = function (e) {
|
|
283
284
|
function t() {
|
|
284
285
|
return i(this, t), s(this, t, ["DeviceCredentialsNotAllowedError", "The device credentials allowment is mismatched. Change the allowDeviceCredentials parameter to be the same in both the register and authenticate methods."]);
|
|
285
286
|
}
|
|
286
|
-
return a(t,
|
|
287
|
+
return a(t, D), r(t);
|
|
287
288
|
}(),
|
|
288
|
-
|
|
289
|
+
q = function (e) {
|
|
289
290
|
function t() {
|
|
290
291
|
return i(this, t), s(this, t, ["MissingGoogleClientIDError", "No Google client ID was found in the project."]);
|
|
291
292
|
}
|
|
292
|
-
return a(t,
|
|
293
|
+
return a(t, D), r(t);
|
|
293
294
|
}(),
|
|
294
|
-
|
|
295
|
+
W = function (e) {
|
|
295
296
|
function t() {
|
|
296
297
|
return i(this, t), s(this, t, ["MissingPKCEError", "Make sure this flow is completed on the same device on which it was started."]);
|
|
297
298
|
}
|
|
298
|
-
return a(t,
|
|
299
|
+
return a(t, D), r(t);
|
|
299
300
|
}(),
|
|
300
|
-
|
|
301
|
+
G = function (e) {
|
|
301
302
|
function t() {
|
|
302
303
|
return i(this, t), s(this, t, ["MissingAuthorizationCredentialIDTokenError", "The authorization credential is missing an ID token."]);
|
|
303
304
|
}
|
|
304
|
-
return a(t,
|
|
305
|
+
return a(t, D), r(t);
|
|
305
306
|
}(),
|
|
306
|
-
|
|
307
|
+
H = function (e) {
|
|
307
308
|
function t() {
|
|
308
309
|
return i(this, t), s(this, t, ["InvalidAuthorizationCredentialError", "The authorization credential is invalid. Verify that OAuth is set up correctly in the developer console, and call the start flow method."]);
|
|
309
310
|
}
|
|
310
|
-
return a(t,
|
|
311
|
+
return a(t, D), r(t);
|
|
311
312
|
}(),
|
|
312
|
-
|
|
313
|
+
z = function (e) {
|
|
313
314
|
function t() {
|
|
314
315
|
return i(this, t), s(this, t, ["MissingPublicKeyError", "Failed to retrieve the public key. Add a new biometric registration."]);
|
|
315
316
|
}
|
|
316
|
-
return a(t,
|
|
317
|
+
return a(t, D), r(t);
|
|
317
318
|
}(),
|
|
318
|
-
|
|
319
|
+
V = function (e) {
|
|
319
320
|
function t() {
|
|
320
321
|
return i(this, t), s(this, t, ["ChallengeSigningFailedError", "Failed to sign the challenge with the key."]);
|
|
321
322
|
}
|
|
322
|
-
return a(t,
|
|
323
|
+
return a(t, D), r(t);
|
|
323
324
|
}(),
|
|
324
325
|
Y = function (e) {
|
|
325
326
|
function t() {
|
|
326
327
|
return i(this, t), s(this, t, ["SDKNotConfiguredError", "Stytch client is not confiured. You must call the configure method before using the SDK"]);
|
|
327
328
|
}
|
|
328
|
-
return a(t,
|
|
329
|
+
return a(t, D), r(t);
|
|
329
330
|
}(),
|
|
330
|
-
|
|
331
|
+
J = function (e) {
|
|
331
332
|
function t() {
|
|
332
333
|
return i(this, t), s(this, t, ["FailedCodeChallengeError", "Failed to create a code challenge"]);
|
|
333
334
|
}
|
|
334
|
-
return a(t,
|
|
335
|
+
return a(t, D), r(t);
|
|
335
336
|
}(),
|
|
336
|
-
|
|
337
|
+
$ = function (e) {
|
|
337
338
|
function t() {
|
|
338
339
|
return i(this, t), s(this, t, ["PasskeysUnsupportedError", "Passkeys are not supported on this device"]);
|
|
339
340
|
}
|
|
340
|
-
return a(t,
|
|
341
|
+
return a(t, D), r(t);
|
|
341
342
|
}(),
|
|
342
|
-
|
|
343
|
+
X = function (e) {
|
|
343
344
|
function t() {
|
|
344
345
|
return i(this, t), s(this, t, ["FailedToDecryptDataError", "Failed to decrypt user data"]);
|
|
345
346
|
}
|
|
346
|
-
return a(t,
|
|
347
|
+
return a(t, D), r(t);
|
|
347
348
|
}(),
|
|
348
|
-
|
|
349
|
+
Z = function (e) {
|
|
349
350
|
function t() {
|
|
350
351
|
return i(this, t), s(this, t, ["BiometricsFailedError", "Biometric authentication failed"]);
|
|
351
352
|
}
|
|
352
|
-
return a(t,
|
|
353
|
+
return a(t, D), r(t);
|
|
353
354
|
}(),
|
|
354
|
-
|
|
355
|
+
Q = function (e) {
|
|
355
356
|
function t() {
|
|
356
357
|
return i(this, t), s(this, t, ["InvalidStartUrlError", "The start URL was invalid or improperly formatted."]);
|
|
357
358
|
}
|
|
358
|
-
return a(t,
|
|
359
|
+
return a(t, D), r(t);
|
|
359
360
|
}(),
|
|
360
|
-
|
|
361
|
+
ee = function (e) {
|
|
361
362
|
function t() {
|
|
362
363
|
return i(this, t), s(this, t, ["InvalidRedirectSchemeError", "The scheme from the given redirect urls was invalid. Possible reasons include: nil scheme, non-custom scheme (using http or https), or differing schemes for login/signup urls."]);
|
|
363
364
|
}
|
|
364
|
-
return a(t,
|
|
365
|
+
return a(t, D), r(t);
|
|
365
366
|
}(),
|
|
366
|
-
|
|
367
|
+
te = function (e) {
|
|
367
368
|
function t() {
|
|
368
369
|
return i(this, t), s(this, t, ["MissingUrlError", "The underlying web authentication service failed to return a URL."]);
|
|
369
370
|
}
|
|
370
|
-
return a(t,
|
|
371
|
+
return a(t, D), r(t);
|
|
371
372
|
}(),
|
|
372
|
-
|
|
373
|
+
re = function (e) {
|
|
373
374
|
function t() {
|
|
374
375
|
return i(this, t), s(this, t, ["InvalidCredentialTypeError", "The public key credential type was not of the expected type."]);
|
|
375
376
|
}
|
|
376
|
-
return a(t,
|
|
377
|
+
return a(t, D), r(t);
|
|
377
378
|
}(),
|
|
378
|
-
|
|
379
|
+
ne = function (e) {
|
|
379
380
|
function t() {
|
|
380
381
|
return i(this, t), s(this, t, ["MissingAttestationObjectError", "The public key credential is missing the attestation object."]);
|
|
381
382
|
}
|
|
382
|
-
return a(t,
|
|
383
|
+
return a(t, D), r(t);
|
|
383
384
|
}(),
|
|
384
|
-
|
|
385
|
+
ie = function (e) {
|
|
385
386
|
function t() {
|
|
386
387
|
return i(this, t), s(this, t, ["JSONDataNotConvertibleToStringError", "JSON data unable to be converted to String type."]);
|
|
387
388
|
}
|
|
388
|
-
return a(t,
|
|
389
|
+
return a(t, D), r(t);
|
|
389
390
|
}(),
|
|
390
|
-
|
|
391
|
+
se = function (e) {
|
|
391
392
|
function t() {
|
|
392
393
|
return i(this, t), s(this, t, ["RandomNumberGenerationFailed", "Random number generation failed"]);
|
|
393
394
|
}
|
|
394
|
-
return a(t,
|
|
395
|
+
return a(t, D), r(t);
|
|
395
396
|
}(),
|
|
396
|
-
|
|
397
|
+
oe = function (e) {
|
|
397
398
|
function t() {
|
|
398
399
|
return i(this, t), s(this, t, ["PasskeysInvalidEncoding", "Invalid passkey encoding"]);
|
|
399
400
|
}
|
|
400
|
-
return a(t,
|
|
401
|
+
return a(t, D), r(t);
|
|
401
402
|
}();
|
|
402
|
-
function
|
|
403
|
+
function ae(e, t) {
|
|
403
404
|
var r = "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
404
405
|
if (!r) {
|
|
405
|
-
if (Array.isArray(e) || (r =
|
|
406
|
+
if (Array.isArray(e) || (r = ue(e)) || t && e && "number" == typeof e.length) {
|
|
406
407
|
r && (e = r);
|
|
407
408
|
var _n = 0,
|
|
408
409
|
i = function i() {};
|
|
@@ -447,7 +448,7 @@ function oe(e, t) {
|
|
|
447
448
|
}
|
|
448
449
|
};
|
|
449
450
|
}
|
|
450
|
-
function
|
|
451
|
+
function ce(e, t) {
|
|
451
452
|
return function (e) {
|
|
452
453
|
if (Array.isArray(e)) return e;
|
|
453
454
|
}(e) || function (e, t) {
|
|
@@ -476,32 +477,32 @@ function ae(e, t) {
|
|
|
476
477
|
}
|
|
477
478
|
return a;
|
|
478
479
|
}
|
|
479
|
-
}(e, t) ||
|
|
480
|
+
}(e, t) || ue(e, t) || function () {
|
|
480
481
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
481
482
|
}();
|
|
482
483
|
}
|
|
483
|
-
function
|
|
484
|
+
function ue(e, t) {
|
|
484
485
|
if (e) {
|
|
485
|
-
if ("string" == typeof e) return
|
|
486
|
+
if ("string" == typeof e) return le(e, t);
|
|
486
487
|
var r = Object.prototype.toString.call(e).slice(8, -1);
|
|
487
|
-
return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
488
|
+
return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? le(e, t) : void 0;
|
|
488
489
|
}
|
|
489
490
|
}
|
|
490
|
-
function
|
|
491
|
+
function le(e, t) {
|
|
491
492
|
(null == t || t > e.length) && (t = e.length);
|
|
492
493
|
for (var r = 0, n = new Array(t); r < t; r++) n[r] = e[r];
|
|
493
494
|
return n;
|
|
494
495
|
}
|
|
495
|
-
function
|
|
496
|
-
return
|
|
496
|
+
function de(e) {
|
|
497
|
+
return de = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
|
|
497
498
|
return _typeof(e);
|
|
498
499
|
} : function (e) {
|
|
499
500
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
|
|
500
|
-
},
|
|
501
|
+
}, de(e);
|
|
501
502
|
}
|
|
502
|
-
function
|
|
503
|
+
function he() {
|
|
503
504
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
504
|
-
|
|
505
|
+
he = function he() {
|
|
505
506
|
return t;
|
|
506
507
|
};
|
|
507
508
|
var e,
|
|
@@ -535,7 +536,7 @@ function de() {
|
|
|
535
536
|
o = Object.create(s.prototype),
|
|
536
537
|
a = new E(n || []);
|
|
537
538
|
return i(o, "_invoke", {
|
|
538
|
-
value:
|
|
539
|
+
value: C(e, r, a)
|
|
539
540
|
}), o;
|
|
540
541
|
}
|
|
541
542
|
function d(e, t, r) {
|
|
@@ -575,13 +576,13 @@ function de() {
|
|
|
575
576
|
});
|
|
576
577
|
});
|
|
577
578
|
}
|
|
578
|
-
function
|
|
579
|
+
function P(e, t) {
|
|
579
580
|
function r(i, s, o, a) {
|
|
580
581
|
var c = d(e[i], e, s);
|
|
581
582
|
if ("throw" !== c.type) {
|
|
582
583
|
var u = c.arg,
|
|
583
584
|
l = u.value;
|
|
584
|
-
return l && "object" ==
|
|
585
|
+
return l && "object" == de(l) && n.call(l, "__await") ? t.resolve(l.__await).then(function (e) {
|
|
585
586
|
r("next", e, o, a);
|
|
586
587
|
}, function (e) {
|
|
587
588
|
r("throw", e, o, a);
|
|
@@ -605,7 +606,7 @@ function de() {
|
|
|
605
606
|
}
|
|
606
607
|
});
|
|
607
608
|
}
|
|
608
|
-
function
|
|
609
|
+
function C(t, r, n) {
|
|
609
610
|
var i = h;
|
|
610
611
|
return function (s, o) {
|
|
611
612
|
if (i === f) throw new Error("Generator is already running");
|
|
@@ -651,20 +652,20 @@ function de() {
|
|
|
651
652
|
var o = s.arg;
|
|
652
653
|
return o ? o.done ? (r[t.resultName] = o.value, r.next = t.nextLoc, "return" !== r.method && (r.method = "next", r.arg = e), r.delegate = null, m) : o : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, m);
|
|
653
654
|
}
|
|
654
|
-
function
|
|
655
|
+
function T(e) {
|
|
655
656
|
var t = {
|
|
656
657
|
tryLoc: e[0]
|
|
657
658
|
};
|
|
658
659
|
1 in e && (t.catchLoc = e[1]), 2 in e && (t.finallyLoc = e[2], t.afterLoc = e[3]), this.tryEntries.push(t);
|
|
659
660
|
}
|
|
660
|
-
function
|
|
661
|
+
function A(e) {
|
|
661
662
|
var t = e.completion || {};
|
|
662
663
|
t.type = "normal", delete t.arg, e.completion = t;
|
|
663
664
|
}
|
|
664
665
|
function E(e) {
|
|
665
666
|
this.tryEntries = [{
|
|
666
667
|
tryLoc: "root"
|
|
667
|
-
}], e.forEach(
|
|
668
|
+
}], e.forEach(T, this), this.reset(!0);
|
|
668
669
|
}
|
|
669
670
|
function D(t) {
|
|
670
671
|
if (t || "" === t) {
|
|
@@ -680,7 +681,7 @@ function de() {
|
|
|
680
681
|
return s.next = s;
|
|
681
682
|
}
|
|
682
683
|
}
|
|
683
|
-
throw new TypeError(
|
|
684
|
+
throw new TypeError(de(t) + " is not iterable");
|
|
684
685
|
}
|
|
685
686
|
return y.prototype = g, i(S, "constructor", {
|
|
686
687
|
value: g,
|
|
@@ -697,11 +698,11 @@ function de() {
|
|
|
697
698
|
return {
|
|
698
699
|
__await: e
|
|
699
700
|
};
|
|
700
|
-
}, x(
|
|
701
|
+
}, x(P.prototype), u(P.prototype, a, function () {
|
|
701
702
|
return this;
|
|
702
|
-
}), t.AsyncIterator =
|
|
703
|
+
}), t.AsyncIterator = P, t.async = function (e, r, n, i, s) {
|
|
703
704
|
void 0 === s && (s = Promise);
|
|
704
|
-
var o = new
|
|
705
|
+
var o = new P(l(e, r, n, i), s);
|
|
705
706
|
return t.isGeneratorFunction(r) ? o : o.next().then(function (e) {
|
|
706
707
|
return e.done ? e.value : o.next();
|
|
707
708
|
});
|
|
@@ -723,7 +724,7 @@ function de() {
|
|
|
723
724
|
}, t.values = D, E.prototype = {
|
|
724
725
|
constructor: E,
|
|
725
726
|
reset: function reset(t) {
|
|
726
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = e, this.done = !1, this.delegate = null, this.method = "next", this.arg = e, this.tryEntries.forEach(
|
|
727
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = e, this.done = !1, this.delegate = null, this.method = "next", this.arg = e, this.tryEntries.forEach(A), !t) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = e);
|
|
727
728
|
},
|
|
728
729
|
stop: function stop() {
|
|
729
730
|
this.done = !0;
|
|
@@ -775,7 +776,7 @@ function de() {
|
|
|
775
776
|
finish: function finish(e) {
|
|
776
777
|
for (var t = this.tryEntries.length - 1; t >= 0; --t) {
|
|
777
778
|
var r = this.tryEntries[t];
|
|
778
|
-
if (r.finallyLoc === e) return this.complete(r.completion, r.afterLoc),
|
|
779
|
+
if (r.finallyLoc === e) return this.complete(r.completion, r.afterLoc), A(r), m;
|
|
779
780
|
}
|
|
780
781
|
},
|
|
781
782
|
"catch": function _catch(e) {
|
|
@@ -785,7 +786,7 @@ function de() {
|
|
|
785
786
|
var n = r.completion;
|
|
786
787
|
if ("throw" === n.type) {
|
|
787
788
|
var i = n.arg;
|
|
788
|
-
|
|
789
|
+
A(r);
|
|
789
790
|
}
|
|
790
791
|
return i;
|
|
791
792
|
}
|
|
@@ -801,46 +802,46 @@ function de() {
|
|
|
801
802
|
}
|
|
802
803
|
}, t;
|
|
803
804
|
}
|
|
804
|
-
function
|
|
805
|
+
function pe(e, t) {
|
|
805
806
|
for (var r = 0; r < t.length; r++) {
|
|
806
807
|
var n = t[r];
|
|
807
|
-
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e,
|
|
808
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, _e(n.key), n);
|
|
808
809
|
}
|
|
809
810
|
}
|
|
810
|
-
function
|
|
811
|
-
return t &&
|
|
811
|
+
function fe(e, t, r) {
|
|
812
|
+
return t && pe(e.prototype, t), r && pe(e, r), Object.defineProperty(e, "prototype", {
|
|
812
813
|
writable: !1
|
|
813
814
|
}), e;
|
|
814
815
|
}
|
|
815
|
-
function
|
|
816
|
+
function _e(e) {
|
|
816
817
|
var t = function (e, t) {
|
|
817
|
-
if ("object" !=
|
|
818
|
+
if ("object" != de(e) || !e) return e;
|
|
818
819
|
var r = e[Symbol.toPrimitive];
|
|
819
820
|
if (void 0 !== r) {
|
|
820
821
|
var n = r.call(e, t || "default");
|
|
821
|
-
if ("object" !=
|
|
822
|
+
if ("object" != de(n)) return n;
|
|
822
823
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
823
824
|
}
|
|
824
825
|
return ("string" === t ? String : Number)(e);
|
|
825
826
|
}(e, "string");
|
|
826
|
-
return "symbol" ==
|
|
827
|
+
return "symbol" == de(t) ? t : String(t);
|
|
827
828
|
}
|
|
828
|
-
function
|
|
829
|
+
function me(e, t) {
|
|
829
830
|
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
830
831
|
}
|
|
831
|
-
function
|
|
832
|
-
return t =
|
|
833
|
-
if (t && ("object" ===
|
|
832
|
+
function ve(e, t, r) {
|
|
833
|
+
return t = ke(t), function (e, t) {
|
|
834
|
+
if (t && ("object" === de(t) || "function" == typeof t)) return t;
|
|
834
835
|
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
835
836
|
return function (e) {
|
|
836
837
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
837
838
|
return e;
|
|
838
839
|
}(e);
|
|
839
|
-
}(e,
|
|
840
|
+
}(e, ge() ? Reflect.construct(t, r || [], ke(e).constructor) : t.apply(e, r));
|
|
840
841
|
}
|
|
841
|
-
function
|
|
842
|
+
function ye(e) {
|
|
842
843
|
var t = "function" == typeof Map ? new Map() : void 0;
|
|
843
|
-
return
|
|
844
|
+
return ye = function ye(e) {
|
|
844
845
|
if (null === e || !function (e) {
|
|
845
846
|
try {
|
|
846
847
|
return -1 !== Function.toString.call(e).indexOf("[native code]");
|
|
@@ -855,12 +856,12 @@ function ve(e) {
|
|
|
855
856
|
}
|
|
856
857
|
function r() {
|
|
857
858
|
return function (e, t, r) {
|
|
858
|
-
if (
|
|
859
|
+
if (ge()) return Reflect.construct.apply(null, arguments);
|
|
859
860
|
var n = [null];
|
|
860
861
|
n.push.apply(n, t);
|
|
861
862
|
var i = new (e.bind.apply(e, n))();
|
|
862
|
-
return r &&
|
|
863
|
-
}(e, arguments,
|
|
863
|
+
return r && be(i, r.prototype), i;
|
|
864
|
+
}(e, arguments, ke(this).constructor);
|
|
864
865
|
}
|
|
865
866
|
return r.prototype = Object.create(e.prototype, {
|
|
866
867
|
constructor: {
|
|
@@ -869,32 +870,32 @@ function ve(e) {
|
|
|
869
870
|
writable: !0,
|
|
870
871
|
configurable: !0
|
|
871
872
|
}
|
|
872
|
-
}),
|
|
873
|
-
},
|
|
873
|
+
}), be(r, e);
|
|
874
|
+
}, ye(e);
|
|
874
875
|
}
|
|
875
|
-
function
|
|
876
|
+
function ge() {
|
|
876
877
|
try {
|
|
877
878
|
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
878
879
|
} catch (e) {}
|
|
879
|
-
return (
|
|
880
|
+
return (ge = function ge() {
|
|
880
881
|
return !!e;
|
|
881
882
|
})();
|
|
882
883
|
}
|
|
883
|
-
function
|
|
884
|
-
return
|
|
884
|
+
function be(e, t) {
|
|
885
|
+
return be = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) {
|
|
885
886
|
return e.__proto__ = t, e;
|
|
886
|
-
},
|
|
887
|
+
}, be(e, t);
|
|
887
888
|
}
|
|
888
|
-
function
|
|
889
|
-
return
|
|
889
|
+
function ke(e) {
|
|
890
|
+
return ke = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) {
|
|
890
891
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
891
|
-
},
|
|
892
|
+
}, ke(e);
|
|
892
893
|
}
|
|
893
|
-
exports.B2BProducts = void 0, (y = exports.B2BProducts || (exports.B2BProducts = {})).emailMagicLinks = "emailMagicLinks", y.sso = "sso", y.passwords = "passwords", y.oauth = "oauth", exports.AuthFlowType = void 0, (g = exports.AuthFlowType || (exports.AuthFlowType = {})).Discovery = "Discovery", g.Organization = "Organization", g.PasswordReset = "PasswordReset", exports.
|
|
894
|
-
var
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
function
|
|
894
|
+
exports.B2BProducts = void 0, (y = exports.B2BProducts || (exports.B2BProducts = {})).emailMagicLinks = "emailMagicLinks", y.sso = "sso", y.passwords = "passwords", y.oauth = "oauth", exports.AuthFlowType = void 0, (g = exports.AuthFlowType || (exports.AuthFlowType = {})).Discovery = "Discovery", g.Organization = "Organization", g.PasswordReset = "PasswordReset", exports.B2BMFAProducts = void 0, (b = exports.B2BMFAProducts || (exports.B2BMFAProducts = {})).smsOtp = "smsOtp", b.totp = "totp", exports.B2BOAuthProviders = void 0, (k = exports.B2BOAuthProviders || (exports.B2BOAuthProviders = {})).Google = "google", k.Microsoft = "microsoft";
|
|
895
|
+
var we,
|
|
896
|
+
Se = "https://accounts.google.com/gsi",
|
|
897
|
+
xe = "".concat(Se, "/client");
|
|
898
|
+
function Pe(e, t) {
|
|
898
899
|
var r = {};
|
|
899
900
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
|
|
900
901
|
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -930,12 +931,12 @@ function Ce(e, t, r, n) {
|
|
|
930
931
|
}
|
|
931
932
|
"function" == typeof SuppressedError && SuppressedError, function (e) {
|
|
932
933
|
e.RequiredCatcha = "Catcha Required";
|
|
933
|
-
}(
|
|
934
|
-
var
|
|
935
|
-
|
|
934
|
+
}(we || (we = {}));
|
|
935
|
+
var Oe,
|
|
936
|
+
Te = function (e) {
|
|
936
937
|
function t(e) {
|
|
937
938
|
var r;
|
|
938
|
-
return
|
|
939
|
+
return me(this, t), (r = ve(this, t, [e])).type = e, r;
|
|
939
940
|
}
|
|
940
941
|
return function (e, t) {
|
|
941
942
|
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
@@ -947,8 +948,8 @@ var Pe,
|
|
|
947
948
|
}
|
|
948
949
|
}), Object.defineProperty(e, "prototype", {
|
|
949
950
|
writable: !1
|
|
950
|
-
}), t &&
|
|
951
|
-
}(t,
|
|
951
|
+
}), t && be(e, t);
|
|
952
|
+
}(t, ye(Error)), fe(t);
|
|
952
953
|
}();
|
|
953
954
|
function Ae(e) {
|
|
954
955
|
var t,
|
|
@@ -958,9 +959,9 @@ function Ae(e) {
|
|
|
958
959
|
s = e.xSDKClientHeader,
|
|
959
960
|
o = e.xSDKParentHostHeader,
|
|
960
961
|
a = e.body;
|
|
961
|
-
return Ce(this, void 0, void 0,
|
|
962
|
+
return Ce(this, void 0, void 0, he().mark(function e() {
|
|
962
963
|
var c, u, l, d, h, p;
|
|
963
|
-
return
|
|
964
|
+
return he().wrap(function (e) {
|
|
964
965
|
for (;;) switch (e.prev = e.next) {
|
|
965
966
|
case 0:
|
|
966
967
|
return c = {
|
|
@@ -980,7 +981,7 @@ function Ae(e) {
|
|
|
980
981
|
e.next = 13;
|
|
981
982
|
break;
|
|
982
983
|
}
|
|
983
|
-
throw new
|
|
984
|
+
throw new T("Unable to contact the Stytch servers. Are you online?");
|
|
984
985
|
case 13:
|
|
985
986
|
throw e.t0;
|
|
986
987
|
case 14:
|
|
@@ -992,7 +993,7 @@ function Ae(e) {
|
|
|
992
993
|
case 18:
|
|
993
994
|
return d = e.sent, e.abrupt("return", d.data);
|
|
994
995
|
case 22:
|
|
995
|
-
throw e.prev = 22, e.t1 = e["catch"](15), new
|
|
996
|
+
throw e.prev = 22, e.t1 = e["catch"](15), new T("Invalid JSON response from the Stytch servers.");
|
|
996
997
|
case 25:
|
|
997
998
|
if (200 === l.status || !(null === (t = l.headers.get("content-type")) || void 0 === t ? void 0 : t.includes("application/json"))) {
|
|
998
999
|
e.next = 38;
|
|
@@ -1003,7 +1004,7 @@ function Ae(e) {
|
|
|
1003
1004
|
h = e.sent, e.next = 35;
|
|
1004
1005
|
break;
|
|
1005
1006
|
case 32:
|
|
1006
|
-
throw e.prev = 32, e.t2 = e["catch"](26), new
|
|
1007
|
+
throw e.prev = 32, e.t2 = e["catch"](26), new T("Invalid or no response from server");
|
|
1007
1008
|
case 35:
|
|
1008
1009
|
if (!("body" in h || "params" in h || "query" in h)) {
|
|
1009
1010
|
e.next = 37;
|
|
@@ -1011,22 +1012,22 @@ function Ae(e) {
|
|
|
1011
1012
|
}
|
|
1012
1013
|
throw new A(h);
|
|
1013
1014
|
case 37:
|
|
1014
|
-
throw new
|
|
1015
|
+
throw new E(h);
|
|
1015
1016
|
case 38:
|
|
1016
1017
|
return e.prev = 38, e.next = 41, l.text();
|
|
1017
1018
|
case 41:
|
|
1018
1019
|
p = e.sent, e.next = 47;
|
|
1019
1020
|
break;
|
|
1020
1021
|
case 44:
|
|
1021
|
-
throw e.prev = 44, e.t3 = e["catch"](38), new
|
|
1022
|
+
throw e.prev = 44, e.t3 = e["catch"](38), new T("Invalid response from the Stytch servers.");
|
|
1022
1023
|
case 47:
|
|
1023
1024
|
if (!p.includes("Captcha required")) {
|
|
1024
1025
|
e.next = 49;
|
|
1025
1026
|
break;
|
|
1026
1027
|
}
|
|
1027
|
-
throw new
|
|
1028
|
+
throw new Te(we.RequiredCatcha);
|
|
1028
1029
|
case 49:
|
|
1029
|
-
throw new
|
|
1030
|
+
throw new T("Invalid response from the Stytch servers.");
|
|
1030
1031
|
case 50:
|
|
1031
1032
|
case "end":
|
|
1032
1033
|
return e.stop();
|
|
@@ -1034,34 +1035,34 @@ function Ae(e) {
|
|
|
1034
1035
|
}, e, null, [[3, 9], [15, 22], [26, 32], [38, 44]]);
|
|
1035
1036
|
}));
|
|
1036
1037
|
}
|
|
1037
|
-
var
|
|
1038
|
-
function
|
|
1039
|
-
if (!
|
|
1040
|
-
return
|
|
1038
|
+
var Ee = new Uint8Array(16);
|
|
1039
|
+
function De() {
|
|
1040
|
+
if (!Oe && !(Oe = "undefined" != typeof crypto && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || "undefined" != typeof msCrypto && "function" == typeof msCrypto.getRandomValues && msCrypto.getRandomValues.bind(msCrypto))) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
1041
|
+
return Oe(Ee);
|
|
1041
1042
|
}
|
|
1042
|
-
var
|
|
1043
|
-
for (var
|
|
1044
|
-
function
|
|
1043
|
+
var Re = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
1044
|
+
for (var Ie = [], Fe = 0; Fe < 256; ++Fe) Ie.push((Fe + 256).toString(16).substr(1));
|
|
1045
|
+
function je(e) {
|
|
1045
1046
|
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
|
|
1046
|
-
r = (
|
|
1047
|
+
r = (Ie[e[t + 0]] + Ie[e[t + 1]] + Ie[e[t + 2]] + Ie[e[t + 3]] + "-" + Ie[e[t + 4]] + Ie[e[t + 5]] + "-" + Ie[e[t + 6]] + Ie[e[t + 7]] + "-" + Ie[e[t + 8]] + Ie[e[t + 9]] + "-" + Ie[e[t + 10]] + Ie[e[t + 11]] + Ie[e[t + 12]] + Ie[e[t + 13]] + Ie[e[t + 14]] + Ie[e[t + 15]]).toLowerCase();
|
|
1047
1048
|
if (!function (e) {
|
|
1048
|
-
return "string" == typeof e &&
|
|
1049
|
+
return "string" == typeof e && Re.test(e);
|
|
1049
1050
|
}(r)) throw TypeError("Stringified UUID is invalid");
|
|
1050
1051
|
return r;
|
|
1051
1052
|
}
|
|
1052
|
-
function
|
|
1053
|
-
var n = (e = e || {}).random || (e.rng ||
|
|
1053
|
+
function Be(e, t, r) {
|
|
1054
|
+
var n = (e = e || {}).random || (e.rng || De)();
|
|
1054
1055
|
if (n[6] = 15 & n[6] | 64, n[8] = 63 & n[8] | 128, t) {
|
|
1055
1056
|
r = r || 0;
|
|
1056
1057
|
for (var i = 0; i < 16; ++i) t[r + i] = n[i];
|
|
1057
1058
|
return t;
|
|
1058
1059
|
}
|
|
1059
|
-
return
|
|
1060
|
+
return je(n);
|
|
1060
1061
|
}
|
|
1061
1062
|
var Le = {};
|
|
1062
|
-
function
|
|
1063
|
-
return Ce(this, void 0, void 0,
|
|
1064
|
-
return
|
|
1063
|
+
function Me(e, t) {
|
|
1064
|
+
return Ce(this, void 0, void 0, he().mark(function r() {
|
|
1065
|
+
return he().wrap(function (r) {
|
|
1065
1066
|
for (;;) switch (r.prev = r.next) {
|
|
1066
1067
|
case 0:
|
|
1067
1068
|
if (void 0 === Le[e]) {
|
|
@@ -1070,7 +1071,7 @@ function Be(e, t) {
|
|
|
1070
1071
|
}
|
|
1071
1072
|
return r.abrupt("return", Le[e]);
|
|
1072
1073
|
case 2:
|
|
1073
|
-
return Le[e] =
|
|
1074
|
+
return Le[e] = Ue(e, t), r.abrupt("return", Le[e]);
|
|
1074
1075
|
case 4:
|
|
1075
1076
|
case "end":
|
|
1076
1077
|
return r.stop();
|
|
@@ -1078,10 +1079,10 @@ function Be(e, t) {
|
|
|
1078
1079
|
}, r);
|
|
1079
1080
|
}));
|
|
1080
1081
|
}
|
|
1081
|
-
function
|
|
1082
|
+
function Ue(e, t) {
|
|
1082
1083
|
return new Promise(function (r, n) {
|
|
1083
1084
|
var i = function (e) {
|
|
1084
|
-
var t =
|
|
1085
|
+
var t = Ne(e);
|
|
1085
1086
|
if (t[0]) return t[0];
|
|
1086
1087
|
}(e);
|
|
1087
1088
|
if (i && "true" === i.dataset.loaded) try {
|
|
@@ -1105,44 +1106,44 @@ function Me(e, t) {
|
|
|
1105
1106
|
});
|
|
1106
1107
|
});
|
|
1107
1108
|
}
|
|
1108
|
-
var
|
|
1109
|
+
var Ne = function Ne(e) {
|
|
1109
1110
|
return document.querySelectorAll('script[src="'.concat(e, '"]'));
|
|
1110
1111
|
};
|
|
1111
|
-
var
|
|
1112
|
-
|
|
1113
|
-
|
|
1112
|
+
var Ke,
|
|
1113
|
+
qe = ["[Stytch]"],
|
|
1114
|
+
We = function We() {
|
|
1114
1115
|
for (var e, t = arguments.length, r = new Array(t), n = 0; n < t; n++) r[n] = arguments[n];
|
|
1115
|
-
return (e = console).warn.apply(e,
|
|
1116
|
+
return (e = console).warn.apply(e, qe.concat(r));
|
|
1116
1117
|
},
|
|
1117
|
-
|
|
1118
|
+
Ge = function Ge() {
|
|
1118
1119
|
for (var e, t = arguments.length, r = new Array(t), n = 0; n < t; n++) r[n] = arguments[n];
|
|
1119
|
-
return (e = console).error.apply(e,
|
|
1120
|
+
return (e = console).error.apply(e, qe.concat(r));
|
|
1120
1121
|
},
|
|
1121
|
-
|
|
1122
|
-
|
|
1122
|
+
He = "\nYou can find your public token at https://stytch.com/dashboard/api-keys.",
|
|
1123
|
+
ze = function ze(e) {
|
|
1123
1124
|
var t = {
|
|
1124
1125
|
isObject: function isObject(r, n) {
|
|
1125
|
-
var i = "object" ===
|
|
1126
|
-
if (!i) throw new
|
|
1126
|
+
var i = "object" === de(n) && !Array.isArray(n) && null !== n;
|
|
1127
|
+
if (!i) throw new S(e, r + " must be an object.");
|
|
1127
1128
|
return t;
|
|
1128
1129
|
},
|
|
1129
1130
|
isOptionalObject: function isOptionalObject(e, r) {
|
|
1130
1131
|
return void 0 === r ? t : t.isObject(e, r);
|
|
1131
1132
|
},
|
|
1132
1133
|
isString: function isString(r, n) {
|
|
1133
|
-
if ("string" != typeof n) throw new
|
|
1134
|
+
if ("string" != typeof n) throw new S(e, r + " must be a string.");
|
|
1134
1135
|
return t;
|
|
1135
1136
|
},
|
|
1136
1137
|
isOptionalString: function isOptionalString(e, r) {
|
|
1137
1138
|
return void 0 === r ? t : t.isString(e, r);
|
|
1138
1139
|
},
|
|
1139
1140
|
isStringArray: function isStringArray(r, n) {
|
|
1140
|
-
if (!Array.isArray(n)) throw new
|
|
1141
|
+
if (!Array.isArray(n)) throw new S(e, r + " must be an array of strings.");
|
|
1141
1142
|
var i,
|
|
1142
|
-
s =
|
|
1143
|
+
s = ae(n);
|
|
1143
1144
|
try {
|
|
1144
1145
|
for (s.s(); !(i = s.n()).done;) {
|
|
1145
|
-
if ("string" != typeof i.value) throw new
|
|
1146
|
+
if ("string" != typeof i.value) throw new S(e, r + " must be an array of strings.");
|
|
1146
1147
|
}
|
|
1147
1148
|
} catch (e) {
|
|
1148
1149
|
s.e(e);
|
|
@@ -1155,14 +1156,14 @@ var Ne,
|
|
|
1155
1156
|
return void 0 === r ? t : t.isStringArray(e, r);
|
|
1156
1157
|
},
|
|
1157
1158
|
isNumber: function isNumber(r, n) {
|
|
1158
|
-
if ("number" != typeof n) throw new
|
|
1159
|
+
if ("number" != typeof n) throw new S(e, r + " must be a number.");
|
|
1159
1160
|
return t;
|
|
1160
1161
|
},
|
|
1161
1162
|
isOptionalNumber: function isOptionalNumber(e, r) {
|
|
1162
1163
|
return void 0 === r ? t : t.isNumber(e, r);
|
|
1163
1164
|
},
|
|
1164
1165
|
isBoolean: function isBoolean(r, n) {
|
|
1165
|
-
if ("boolean" != typeof n) throw new
|
|
1166
|
+
if ("boolean" != typeof n) throw new S(e, r + " must be a boolean.");
|
|
1166
1167
|
return t;
|
|
1167
1168
|
},
|
|
1168
1169
|
isOptionalBoolean: function isOptionalBoolean(e, r) {
|
|
@@ -1171,20 +1172,20 @@ var Ne,
|
|
|
1171
1172
|
};
|
|
1172
1173
|
return t;
|
|
1173
1174
|
},
|
|
1174
|
-
|
|
1175
|
-
return
|
|
1175
|
+
Ve = function Ve(e) {
|
|
1176
|
+
return Pe(e, ["request_id", "status_code"]);
|
|
1176
1177
|
},
|
|
1177
1178
|
Ye = function Ye(e) {
|
|
1178
|
-
return
|
|
1179
|
+
return Pe(e, ["__user"]);
|
|
1179
1180
|
},
|
|
1180
|
-
|
|
1181
|
+
Je = fe(function e(t, r, n) {
|
|
1181
1182
|
var i = this,
|
|
1182
1183
|
s = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : function () {
|
|
1183
1184
|
return Promise.resolve(void 0);
|
|
1184
1185
|
};
|
|
1185
|
-
|
|
1186
|
-
return Ce(i, void 0, void 0,
|
|
1187
|
-
return
|
|
1186
|
+
me(this, e), this.bootstrapPromise = n, this.isEnabled = function () {
|
|
1187
|
+
return Ce(i, void 0, void 0, he().mark(function e() {
|
|
1188
|
+
return he().wrap(function (e) {
|
|
1188
1189
|
for (;;) switch (e.prev = e.next) {
|
|
1189
1190
|
case 0:
|
|
1190
1191
|
return e.abrupt("return", this.state.then(function (e) {
|
|
@@ -1197,9 +1198,9 @@ var Ne,
|
|
|
1197
1198
|
}, e, this);
|
|
1198
1199
|
}));
|
|
1199
1200
|
}, this.getTelemetryID = function () {
|
|
1200
|
-
return Ce(i, void 0, void 0,
|
|
1201
|
+
return Ce(i, void 0, void 0, he().mark(function e() {
|
|
1201
1202
|
var t, r, n, i;
|
|
1202
|
-
return
|
|
1203
|
+
return he().wrap(function (e) {
|
|
1203
1204
|
for (;;) switch (e.prev = e.next) {
|
|
1204
1205
|
case 0:
|
|
1205
1206
|
return e.next = 2, this.state;
|
|
@@ -1220,9 +1221,9 @@ var Ne,
|
|
|
1220
1221
|
}, e, this);
|
|
1221
1222
|
}));
|
|
1222
1223
|
}, this.getDFPTelemetryIDAndCaptcha = function () {
|
|
1223
|
-
return Ce(i, void 0, void 0,
|
|
1224
|
+
return Ce(i, void 0, void 0, he().mark(function e() {
|
|
1224
1225
|
var t, r, n, i, s, o;
|
|
1225
|
-
return
|
|
1226
|
+
return he().wrap(function (e) {
|
|
1226
1227
|
for (;;) switch (e.prev = e.next) {
|
|
1227
1228
|
case 0:
|
|
1228
1229
|
return e.next = 2, this.state;
|
|
@@ -1265,14 +1266,14 @@ var Ne,
|
|
|
1265
1266
|
}, e, this);
|
|
1266
1267
|
}));
|
|
1267
1268
|
}, this.retryWithCaptchaAndDFP = function (e, t) {
|
|
1268
|
-
return Ce(i, void 0, void 0,
|
|
1269
|
+
return Ce(i, void 0, void 0, he().mark(function r() {
|
|
1269
1270
|
var n, i, s;
|
|
1270
|
-
return
|
|
1271
|
+
return he().wrap(function (r) {
|
|
1271
1272
|
for (;;) switch (r.prev = r.next) {
|
|
1272
1273
|
case 0:
|
|
1273
1274
|
return r.next = 2, this.state;
|
|
1274
1275
|
case 2:
|
|
1275
|
-
if (n = r.sent, i = n.enabled, s = n.executeRecaptcha, e.type !==
|
|
1276
|
+
if (n = r.sent, i = n.enabled, s = n.executeRecaptcha, e.type !== we.RequiredCatcha || !i) {
|
|
1276
1277
|
r.next = 14;
|
|
1277
1278
|
break;
|
|
1278
1279
|
}
|
|
@@ -1296,8 +1297,8 @@ var Ne,
|
|
|
1296
1297
|
}, r, this);
|
|
1297
1298
|
}));
|
|
1298
1299
|
}, this.state = n.then(function (e) {
|
|
1299
|
-
return Ce(i, void 0, void 0,
|
|
1300
|
-
return
|
|
1300
|
+
return Ce(i, void 0, void 0, he().mark(function n() {
|
|
1301
|
+
return he().wrap(function (n) {
|
|
1301
1302
|
for (;;) switch (n.prev = n.next) {
|
|
1302
1303
|
case 0:
|
|
1303
1304
|
if (e.runDFPProtectedAuth) {
|
|
@@ -1312,7 +1313,7 @@ var Ne,
|
|
|
1312
1313
|
executeRecaptcha: s
|
|
1313
1314
|
});
|
|
1314
1315
|
case 2:
|
|
1315
|
-
return n.next = 4, void
|
|
1316
|
+
return n.next = 4, void Me("".concat("https://elements.stytch.com", "/telemetry.js"), function () {
|
|
1316
1317
|
return window;
|
|
1317
1318
|
});
|
|
1318
1319
|
case 4:
|
|
@@ -1332,11 +1333,11 @@ var Ne,
|
|
|
1332
1333
|
}));
|
|
1333
1334
|
});
|
|
1334
1335
|
}),
|
|
1335
|
-
|
|
1336
|
+
$e = function $e() {
|
|
1336
1337
|
return {
|
|
1337
1338
|
isEnabled: function isEnabled() {
|
|
1338
|
-
return Ce(void 0, void 0, void 0,
|
|
1339
|
-
return
|
|
1339
|
+
return Ce(void 0, void 0, void 0, he().mark(function e() {
|
|
1340
|
+
return he().wrap(function (e) {
|
|
1340
1341
|
for (;;) switch (e.prev = e.next) {
|
|
1341
1342
|
case 0:
|
|
1342
1343
|
return e.abrupt("return", !1);
|
|
@@ -1348,8 +1349,8 @@ var Ne,
|
|
|
1348
1349
|
}));
|
|
1349
1350
|
},
|
|
1350
1351
|
getTelemetryID: function getTelemetryID() {
|
|
1351
|
-
return Ce(void 0, void 0, void 0,
|
|
1352
|
-
return
|
|
1352
|
+
return Ce(void 0, void 0, void 0, he().mark(function e() {
|
|
1353
|
+
return he().wrap(function (e) {
|
|
1353
1354
|
for (;;) switch (e.prev = e.next) {
|
|
1354
1355
|
case 0:
|
|
1355
1356
|
return e.abrupt("return", void 0);
|
|
@@ -1361,8 +1362,8 @@ var Ne,
|
|
|
1361
1362
|
}));
|
|
1362
1363
|
},
|
|
1363
1364
|
getDFPTelemetryIDAndCaptcha: function getDFPTelemetryIDAndCaptcha() {
|
|
1364
|
-
return Ce(void 0, void 0, void 0,
|
|
1365
|
-
return
|
|
1365
|
+
return Ce(void 0, void 0, void 0, he().mark(function e() {
|
|
1366
|
+
return he().wrap(function (e) {
|
|
1366
1367
|
for (;;) switch (e.prev = e.next) {
|
|
1367
1368
|
case 0:
|
|
1368
1369
|
return e.abrupt("return", {
|
|
@@ -1377,8 +1378,8 @@ var Ne,
|
|
|
1377
1378
|
}));
|
|
1378
1379
|
},
|
|
1379
1380
|
retryWithCaptchaAndDFP: function retryWithCaptchaAndDFP() {
|
|
1380
|
-
return Ce(void 0, void 0, void 0,
|
|
1381
|
-
return
|
|
1381
|
+
return Ce(void 0, void 0, void 0, he().mark(function e() {
|
|
1382
|
+
return he().wrap(function (e) {
|
|
1382
1383
|
for (;;) switch (e.prev = e.next) {
|
|
1383
1384
|
case 0:
|
|
1384
1385
|
throw new Error("DFP protected auth is disabled");
|
|
@@ -1391,11 +1392,11 @@ var Ne,
|
|
|
1391
1392
|
}
|
|
1392
1393
|
};
|
|
1393
1394
|
},
|
|
1394
|
-
|
|
1395
|
+
Xe = function () {
|
|
1395
1396
|
function e() {
|
|
1396
|
-
|
|
1397
|
+
me(this, e);
|
|
1397
1398
|
}
|
|
1398
|
-
return
|
|
1399
|
+
return fe(e, null, [{
|
|
1399
1400
|
key: "marshall",
|
|
1400
1401
|
value: function value(e) {
|
|
1401
1402
|
return Object.assign(Object.assign({}, e), {
|
|
@@ -1415,17 +1416,17 @@ var Ne,
|
|
|
1415
1416
|
value: function value(t) {
|
|
1416
1417
|
if ("name" in t) switch (t.name) {
|
|
1417
1418
|
case "SDKAPIUnreachableError":
|
|
1418
|
-
return e.inflate(
|
|
1419
|
+
return e.inflate(w, t);
|
|
1419
1420
|
case "StytchSDKSchemaError":
|
|
1420
|
-
return e.inflate(
|
|
1421
|
+
return e.inflate(x, t);
|
|
1421
1422
|
case "StytchAPIUnreachableError":
|
|
1422
|
-
return e.inflate(
|
|
1423
|
+
return e.inflate(T, t);
|
|
1423
1424
|
case "StytchAPISchemaError":
|
|
1424
1425
|
return e.inflate(A, t);
|
|
1425
1426
|
case "StytchSDKAPIError":
|
|
1426
|
-
return e.inflate(
|
|
1427
|
+
return e.inflate(P, t);
|
|
1427
1428
|
case "StytchAPIError":
|
|
1428
|
-
return e.inflate(
|
|
1429
|
+
return e.inflate(E, t);
|
|
1429
1430
|
case "TypeError":
|
|
1430
1431
|
return e.inflate(TypeError, t);
|
|
1431
1432
|
case "SyntaxError":
|
|
@@ -1443,11 +1444,11 @@ var Ne,
|
|
|
1443
1444
|
}
|
|
1444
1445
|
}]), e;
|
|
1445
1446
|
}(),
|
|
1446
|
-
|
|
1447
|
+
Ze = function () {
|
|
1447
1448
|
function e(t) {
|
|
1448
|
-
|
|
1449
|
+
me(this, e), this.maxBatchSize = t.maxBatchSize, this.logEventURL = t.logEventURL, setInterval(this.flush.bind(this), t.intervalDurationMs), this.batch = [];
|
|
1449
1450
|
}
|
|
1450
|
-
return
|
|
1451
|
+
return fe(e, [{
|
|
1451
1452
|
key: "logEvent",
|
|
1452
1453
|
value: function value(e, t) {
|
|
1453
1454
|
this.batch.push({
|
|
@@ -1458,9 +1459,9 @@ var Ne,
|
|
|
1458
1459
|
}, {
|
|
1459
1460
|
key: "flush",
|
|
1460
1461
|
value: function value() {
|
|
1461
|
-
return Ce(this, void 0, void 0,
|
|
1462
|
+
return Ce(this, void 0, void 0, he().mark(function e() {
|
|
1462
1463
|
var t;
|
|
1463
|
-
return
|
|
1464
|
+
return he().wrap(function (e) {
|
|
1464
1465
|
for (;;) switch (e.prev = e.next) {
|
|
1465
1466
|
case 0:
|
|
1466
1467
|
if (this.batch.length) {
|
|
@@ -1492,13 +1493,13 @@ var Ne,
|
|
|
1492
1493
|
}();
|
|
1493
1494
|
!function (e) {
|
|
1494
1495
|
e.LoginOrCreateEML = "login_or_create_eml", e.LoginOrCreateOTP = "login_or_create_otp", e.ResetPassword = "reset_password";
|
|
1495
|
-
}(
|
|
1496
|
-
var
|
|
1496
|
+
}(Ke || (Ke = {}));
|
|
1497
|
+
var Qe = fe(function e(t, r) {
|
|
1497
1498
|
var n = this;
|
|
1498
|
-
|
|
1499
|
-
return Ce(n, void 0, void 0,
|
|
1499
|
+
me(this, e), this._networkClient = t, this._subscriptionService = r, this.get = function () {
|
|
1500
|
+
return Ce(n, void 0, void 0, he().mark(function e() {
|
|
1500
1501
|
var t, r;
|
|
1501
|
-
return
|
|
1502
|
+
return he().wrap(function (e) {
|
|
1502
1503
|
for (;;) switch (e.prev = e.next) {
|
|
1503
1504
|
case 0:
|
|
1504
1505
|
return e.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1507,7 +1508,7 @@ var Ze = pe(function e(t, r) {
|
|
|
1507
1508
|
method: "GET"
|
|
1508
1509
|
});
|
|
1509
1510
|
case 2:
|
|
1510
|
-
return t = e.sent, r =
|
|
1511
|
+
return t = e.sent, r = Ve(t), this._subscriptionService.updateUser(r), e.abrupt("return", r);
|
|
1511
1512
|
case 6:
|
|
1512
1513
|
case "end":
|
|
1513
1514
|
return e.stop();
|
|
@@ -1517,19 +1518,19 @@ var Ze = pe(function e(t, r) {
|
|
|
1517
1518
|
}, this.getSync = function () {
|
|
1518
1519
|
return n._subscriptionService.getUser();
|
|
1519
1520
|
}, this.update = function (e) {
|
|
1520
|
-
return Ce(n, void 0, void 0,
|
|
1521
|
+
return Ce(n, void 0, void 0, he().mark(function t() {
|
|
1521
1522
|
var r, n;
|
|
1522
|
-
return
|
|
1523
|
+
return he().wrap(function (t) {
|
|
1523
1524
|
for (;;) switch (t.prev = t.next) {
|
|
1524
1525
|
case 0:
|
|
1525
|
-
return
|
|
1526
|
+
return ze("stytch.user.update").isOptionalObject("untrusted_metadata", e.untrusted_metadata), t.next = 3, this._networkClient.fetchSDK({
|
|
1526
1527
|
url: "/users/me",
|
|
1527
1528
|
body: e,
|
|
1528
1529
|
errorMessage: "Failed to update user.",
|
|
1529
1530
|
method: "PUT"
|
|
1530
1531
|
});
|
|
1531
1532
|
case 3:
|
|
1532
|
-
return r = t.sent, n =
|
|
1533
|
+
return r = t.sent, n = Ve(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Ye(r));
|
|
1533
1534
|
case 7:
|
|
1534
1535
|
case "end":
|
|
1535
1536
|
return t.stop();
|
|
@@ -1537,9 +1538,9 @@ var Ze = pe(function e(t, r) {
|
|
|
1537
1538
|
}, t, this);
|
|
1538
1539
|
}));
|
|
1539
1540
|
}, this.deleteEmail = function (e) {
|
|
1540
|
-
return Ce(n, void 0, void 0,
|
|
1541
|
+
return Ce(n, void 0, void 0, he().mark(function t() {
|
|
1541
1542
|
var r, n;
|
|
1542
|
-
return
|
|
1543
|
+
return he().wrap(function (t) {
|
|
1543
1544
|
for (;;) switch (t.prev = t.next) {
|
|
1544
1545
|
case 0:
|
|
1545
1546
|
return t.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1548,7 +1549,7 @@ var Ze = pe(function e(t, r) {
|
|
|
1548
1549
|
method: "DELETE"
|
|
1549
1550
|
});
|
|
1550
1551
|
case 2:
|
|
1551
|
-
return r = t.sent, n =
|
|
1552
|
+
return r = t.sent, n = Ve(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Ye(r));
|
|
1552
1553
|
case 6:
|
|
1553
1554
|
case "end":
|
|
1554
1555
|
return t.stop();
|
|
@@ -1556,9 +1557,9 @@ var Ze = pe(function e(t, r) {
|
|
|
1556
1557
|
}, t, this);
|
|
1557
1558
|
}));
|
|
1558
1559
|
}, this.deletePhoneNumber = function (e) {
|
|
1559
|
-
return Ce(n, void 0, void 0,
|
|
1560
|
+
return Ce(n, void 0, void 0, he().mark(function t() {
|
|
1560
1561
|
var r, n;
|
|
1561
|
-
return
|
|
1562
|
+
return he().wrap(function (t) {
|
|
1562
1563
|
for (;;) switch (t.prev = t.next) {
|
|
1563
1564
|
case 0:
|
|
1564
1565
|
return t.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1567,7 +1568,7 @@ var Ze = pe(function e(t, r) {
|
|
|
1567
1568
|
method: "DELETE"
|
|
1568
1569
|
});
|
|
1569
1570
|
case 2:
|
|
1570
|
-
return r = t.sent, n =
|
|
1571
|
+
return r = t.sent, n = Ve(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Ye(r));
|
|
1571
1572
|
case 6:
|
|
1572
1573
|
case "end":
|
|
1573
1574
|
return t.stop();
|
|
@@ -1575,9 +1576,9 @@ var Ze = pe(function e(t, r) {
|
|
|
1575
1576
|
}, t, this);
|
|
1576
1577
|
}));
|
|
1577
1578
|
}, this.deleteTOTP = function (e) {
|
|
1578
|
-
return Ce(n, void 0, void 0,
|
|
1579
|
+
return Ce(n, void 0, void 0, he().mark(function t() {
|
|
1579
1580
|
var r, n;
|
|
1580
|
-
return
|
|
1581
|
+
return he().wrap(function (t) {
|
|
1581
1582
|
for (;;) switch (t.prev = t.next) {
|
|
1582
1583
|
case 0:
|
|
1583
1584
|
return t.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1586,7 +1587,7 @@ var Ze = pe(function e(t, r) {
|
|
|
1586
1587
|
method: "DELETE"
|
|
1587
1588
|
});
|
|
1588
1589
|
case 2:
|
|
1589
|
-
return r = t.sent, n =
|
|
1590
|
+
return r = t.sent, n = Ve(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Ye(r));
|
|
1590
1591
|
case 6:
|
|
1591
1592
|
case "end":
|
|
1592
1593
|
return t.stop();
|
|
@@ -1594,9 +1595,9 @@ var Ze = pe(function e(t, r) {
|
|
|
1594
1595
|
}, t, this);
|
|
1595
1596
|
}));
|
|
1596
1597
|
}, this.deleteOAuthRegistration = function (e) {
|
|
1597
|
-
return Ce(n, void 0, void 0,
|
|
1598
|
+
return Ce(n, void 0, void 0, he().mark(function t() {
|
|
1598
1599
|
var r, n;
|
|
1599
|
-
return
|
|
1600
|
+
return he().wrap(function (t) {
|
|
1600
1601
|
for (;;) switch (t.prev = t.next) {
|
|
1601
1602
|
case 0:
|
|
1602
1603
|
return t.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1605,7 +1606,7 @@ var Ze = pe(function e(t, r) {
|
|
|
1605
1606
|
method: "DELETE"
|
|
1606
1607
|
});
|
|
1607
1608
|
case 2:
|
|
1608
|
-
return r = t.sent, n =
|
|
1609
|
+
return r = t.sent, n = Ve(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Ye(r));
|
|
1609
1610
|
case 6:
|
|
1610
1611
|
case "end":
|
|
1611
1612
|
return t.stop();
|
|
@@ -1613,9 +1614,9 @@ var Ze = pe(function e(t, r) {
|
|
|
1613
1614
|
}, t, this);
|
|
1614
1615
|
}));
|
|
1615
1616
|
}, this.deleteWebauthnRegistration = function (e) {
|
|
1616
|
-
return Ce(n, void 0, void 0,
|
|
1617
|
+
return Ce(n, void 0, void 0, he().mark(function t() {
|
|
1617
1618
|
var r, n;
|
|
1618
|
-
return
|
|
1619
|
+
return he().wrap(function (t) {
|
|
1619
1620
|
for (;;) switch (t.prev = t.next) {
|
|
1620
1621
|
case 0:
|
|
1621
1622
|
return t.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1624,7 +1625,7 @@ var Ze = pe(function e(t, r) {
|
|
|
1624
1625
|
method: "DELETE"
|
|
1625
1626
|
});
|
|
1626
1627
|
case 2:
|
|
1627
|
-
return r = t.sent, n =
|
|
1628
|
+
return r = t.sent, n = Ve(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Ye(r));
|
|
1628
1629
|
case 6:
|
|
1629
1630
|
case "end":
|
|
1630
1631
|
return t.stop();
|
|
@@ -1632,9 +1633,9 @@ var Ze = pe(function e(t, r) {
|
|
|
1632
1633
|
}, t, this);
|
|
1633
1634
|
}));
|
|
1634
1635
|
}, this.deleteBiometricRegistration = function (e) {
|
|
1635
|
-
return Ce(n, void 0, void 0,
|
|
1636
|
+
return Ce(n, void 0, void 0, he().mark(function t() {
|
|
1636
1637
|
var r, n;
|
|
1637
|
-
return
|
|
1638
|
+
return he().wrap(function (t) {
|
|
1638
1639
|
for (;;) switch (t.prev = t.next) {
|
|
1639
1640
|
case 0:
|
|
1640
1641
|
return t.next = 2, this._networkClient.fetchSDK({
|
|
@@ -1643,7 +1644,7 @@ var Ze = pe(function e(t, r) {
|
|
|
1643
1644
|
method: "DELETE"
|
|
1644
1645
|
});
|
|
1645
1646
|
case 2:
|
|
1646
|
-
return r = t.sent, n =
|
|
1647
|
+
return r = t.sent, n = Ve(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Ye(r));
|
|
1647
1648
|
case 6:
|
|
1648
1649
|
case "end":
|
|
1649
1650
|
return t.stop();
|
|
@@ -1658,10 +1659,10 @@ var Ze = pe(function e(t, r) {
|
|
|
1658
1659
|
});
|
|
1659
1660
|
};
|
|
1660
1661
|
}),
|
|
1661
|
-
|
|
1662
|
+
et = function () {
|
|
1662
1663
|
function e(t, r) {
|
|
1663
1664
|
var n = this;
|
|
1664
|
-
|
|
1665
|
+
me(this, e), this._networkClient = t, this._subscriptionService = r, this.getSync = function () {
|
|
1665
1666
|
return n._subscriptionService.getSession();
|
|
1666
1667
|
}, this.onChange = function (e) {
|
|
1667
1668
|
var t = n._subscriptionService.getSession();
|
|
@@ -1670,9 +1671,9 @@ var Ze = pe(function e(t, r) {
|
|
|
1670
1671
|
(null == r ? void 0 : r.session) !== t && (t = null !== (n = null == r ? void 0 : r.session) && void 0 !== n ? n : null, e(t));
|
|
1671
1672
|
});
|
|
1672
1673
|
}, this.revoke = function (e) {
|
|
1673
|
-
return Ce(n, void 0, void 0,
|
|
1674
|
+
return Ce(n, void 0, void 0, he().mark(function t() {
|
|
1674
1675
|
var r;
|
|
1675
|
-
return
|
|
1676
|
+
return he().wrap(function (t) {
|
|
1676
1677
|
for (;;) switch (t.prev = t.next) {
|
|
1677
1678
|
case 0:
|
|
1678
1679
|
return t.prev = 0, t.next = 3, this._networkClient.fetchSDK({
|
|
@@ -1691,13 +1692,13 @@ var Ze = pe(function e(t, r) {
|
|
|
1691
1692
|
}, t, this, [[0, 8]]);
|
|
1692
1693
|
}));
|
|
1693
1694
|
}, this.authenticate = function (e) {
|
|
1694
|
-
return Ce(n, void 0, void 0,
|
|
1695
|
+
return Ce(n, void 0, void 0, he().mark(function t() {
|
|
1695
1696
|
var r,
|
|
1696
1697
|
n,
|
|
1697
1698
|
i,
|
|
1698
1699
|
s,
|
|
1699
1700
|
o = this;
|
|
1700
|
-
return
|
|
1701
|
+
return he().wrap(function (t) {
|
|
1701
1702
|
for (;;) switch (t.prev = t.next) {
|
|
1702
1703
|
case 0:
|
|
1703
1704
|
return r = this._subscriptionService.getSession(), n = function n() {
|
|
@@ -1743,7 +1744,7 @@ var Ze = pe(function e(t, r) {
|
|
|
1743
1744
|
}));
|
|
1744
1745
|
};
|
|
1745
1746
|
}
|
|
1746
|
-
return
|
|
1747
|
+
return fe(e, [{
|
|
1747
1748
|
key: "getTokens",
|
|
1748
1749
|
value: function value() {
|
|
1749
1750
|
return this._subscriptionService.getTokens();
|
|
@@ -1755,20 +1756,20 @@ var Ze = pe(function e(t, r) {
|
|
|
1755
1756
|
}
|
|
1756
1757
|
}]), e;
|
|
1757
1758
|
}(),
|
|
1758
|
-
|
|
1759
|
+
tt = Promise.resolve({
|
|
1759
1760
|
pkceRequiredForEmailMagicLinks: !1
|
|
1760
1761
|
}),
|
|
1761
|
-
|
|
1762
|
+
rt = function () {
|
|
1762
1763
|
function e(t, r, n, i) {
|
|
1763
1764
|
var s = this,
|
|
1764
|
-
o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] :
|
|
1765
|
-
a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] :
|
|
1766
|
-
|
|
1765
|
+
o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : tt,
|
|
1766
|
+
a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : $e();
|
|
1767
|
+
me(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._passwordResetPKCEManager = i, this._config = o, this.dfpProtectedAuth = a, this.email = {
|
|
1767
1768
|
loginOrCreate: function loginOrCreate(e) {
|
|
1768
1769
|
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
|
|
1769
|
-
return Ce(s, void 0, void 0,
|
|
1770
|
+
return Ce(s, void 0, void 0, he().mark(function r() {
|
|
1770
1771
|
var n, i, s, o, a, c, u;
|
|
1771
|
-
return
|
|
1772
|
+
return he().wrap(function (r) {
|
|
1772
1773
|
for (;;) switch (r.prev = r.next) {
|
|
1773
1774
|
case 0:
|
|
1774
1775
|
return r.next = 2, this._config;
|
|
@@ -1804,9 +1805,9 @@ var Ze = pe(function e(t, r) {
|
|
|
1804
1805
|
},
|
|
1805
1806
|
send: function send(e) {
|
|
1806
1807
|
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
|
|
1807
|
-
return Ce(s, void 0, void 0,
|
|
1808
|
+
return Ce(s, void 0, void 0, he().mark(function r() {
|
|
1808
1809
|
var n, i, s, o, a, c, u, l, d;
|
|
1809
|
-
return
|
|
1810
|
+
return he().wrap(function (r) {
|
|
1810
1811
|
for (;;) switch (r.prev = r.next) {
|
|
1811
1812
|
case 0:
|
|
1812
1813
|
return r.next = 2, this._config;
|
|
@@ -1841,12 +1842,12 @@ var Ze = pe(function e(t, r) {
|
|
|
1841
1842
|
}));
|
|
1842
1843
|
}
|
|
1843
1844
|
}, this.authenticate = function (e, t) {
|
|
1844
|
-
return Ce(s, void 0, void 0,
|
|
1845
|
+
return Ce(s, void 0, void 0, he().mark(function r() {
|
|
1845
1846
|
var n, i;
|
|
1846
|
-
return
|
|
1847
|
+
return he().wrap(function (r) {
|
|
1847
1848
|
for (;;) switch (r.prev = r.next) {
|
|
1848
1849
|
case 0:
|
|
1849
|
-
return
|
|
1850
|
+
return ze("stytch.magicLinks.authenticate").isString("Token", e).isNumber("session_duration_minutes", t.session_duration_minutes), r.next = 3, this._passwordResetPKCEManager.getPKPair();
|
|
1850
1851
|
case 3:
|
|
1851
1852
|
if (n = r.sent, i = null, !(null == n ? void 0 : n.code_verifier)) {
|
|
1852
1853
|
r.next = 19;
|
|
@@ -1895,12 +1896,12 @@ var Ze = pe(function e(t, r) {
|
|
|
1895
1896
|
}));
|
|
1896
1897
|
};
|
|
1897
1898
|
}
|
|
1898
|
-
return
|
|
1899
|
+
return fe(e, [{
|
|
1899
1900
|
key: "getCodeChallenge",
|
|
1900
1901
|
value: function value() {
|
|
1901
|
-
return Ce(this, void 0, void 0,
|
|
1902
|
+
return Ce(this, void 0, void 0, he().mark(function e() {
|
|
1902
1903
|
var t;
|
|
1903
|
-
return
|
|
1904
|
+
return he().wrap(function (e) {
|
|
1904
1905
|
for (;;) switch (e.prev = e.next) {
|
|
1905
1906
|
case 0:
|
|
1906
1907
|
return e.next = 2, this._pkceManager.getPKPair();
|
|
@@ -1924,9 +1925,9 @@ var Ze = pe(function e(t, r) {
|
|
|
1924
1925
|
}, {
|
|
1925
1926
|
key: "handlePKCEForAuthenticate",
|
|
1926
1927
|
value: function value(e, t) {
|
|
1927
|
-
return Ce(this, void 0, void 0,
|
|
1928
|
+
return Ce(this, void 0, void 0, he().mark(function r() {
|
|
1928
1929
|
var n, i, s;
|
|
1929
|
-
return
|
|
1930
|
+
return he().wrap(function (r) {
|
|
1930
1931
|
for (;;) switch (r.prev = r.next) {
|
|
1931
1932
|
case 0:
|
|
1932
1933
|
return r.next = 2, e.getPKPair();
|
|
@@ -1950,17 +1951,17 @@ var Ze = pe(function e(t, r) {
|
|
|
1950
1951
|
}
|
|
1951
1952
|
}]), e;
|
|
1952
1953
|
}(),
|
|
1953
|
-
|
|
1954
|
+
nt = fe(function e(t, r) {
|
|
1954
1955
|
var n = this,
|
|
1955
1956
|
i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : function () {
|
|
1956
1957
|
return Promise.resolve(void 0);
|
|
1957
1958
|
},
|
|
1958
|
-
s = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] :
|
|
1959
|
-
|
|
1959
|
+
s = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : $e();
|
|
1960
|
+
me(this, e), this._networkClient = t, this._subscriptionService = r, this.executeRecaptcha = i, this.dfpProtectedAuth = s, this.sms = {
|
|
1960
1961
|
loginOrCreate: function loginOrCreate(e, t) {
|
|
1961
|
-
return Ce(n, void 0, void 0,
|
|
1962
|
+
return Ce(n, void 0, void 0, he().mark(function r() {
|
|
1962
1963
|
var n, i, s, o;
|
|
1963
|
-
return
|
|
1964
|
+
return he().wrap(function (r) {
|
|
1964
1965
|
for (;;) switch (r.prev = r.next) {
|
|
1965
1966
|
case 0:
|
|
1966
1967
|
return r.next = 2, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
@@ -1984,9 +1985,9 @@ var Ze = pe(function e(t, r) {
|
|
|
1984
1985
|
}));
|
|
1985
1986
|
},
|
|
1986
1987
|
send: function send(e, t) {
|
|
1987
|
-
return Ce(n, void 0, void 0,
|
|
1988
|
+
return Ce(n, void 0, void 0, he().mark(function r() {
|
|
1988
1989
|
var n, i, s, o, a, c;
|
|
1989
|
-
return
|
|
1990
|
+
return he().wrap(function (r) {
|
|
1990
1991
|
for (;;) switch (r.prev = r.next) {
|
|
1991
1992
|
case 0:
|
|
1992
1993
|
return r.next = 2, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
@@ -2011,9 +2012,9 @@ var Ze = pe(function e(t, r) {
|
|
|
2011
2012
|
}
|
|
2012
2013
|
}, this.whatsapp = {
|
|
2013
2014
|
loginOrCreate: function loginOrCreate(e, t) {
|
|
2014
|
-
return Ce(n, void 0, void 0,
|
|
2015
|
+
return Ce(n, void 0, void 0, he().mark(function r() {
|
|
2015
2016
|
var n, i, s, o;
|
|
2016
|
-
return
|
|
2017
|
+
return he().wrap(function (r) {
|
|
2017
2018
|
for (;;) switch (r.prev = r.next) {
|
|
2018
2019
|
case 0:
|
|
2019
2020
|
return r.next = 2, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
@@ -2037,9 +2038,9 @@ var Ze = pe(function e(t, r) {
|
|
|
2037
2038
|
}));
|
|
2038
2039
|
},
|
|
2039
2040
|
send: function send(e, t) {
|
|
2040
|
-
return Ce(n, void 0, void 0,
|
|
2041
|
+
return Ce(n, void 0, void 0, he().mark(function r() {
|
|
2041
2042
|
var n, i, s, o, a, c;
|
|
2042
|
-
return
|
|
2043
|
+
return he().wrap(function (r) {
|
|
2043
2044
|
for (;;) switch (r.prev = r.next) {
|
|
2044
2045
|
case 0:
|
|
2045
2046
|
return r.next = 2, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
@@ -2064,9 +2065,9 @@ var Ze = pe(function e(t, r) {
|
|
|
2064
2065
|
}
|
|
2065
2066
|
}, this.email = {
|
|
2066
2067
|
loginOrCreate: function loginOrCreate(e, t) {
|
|
2067
|
-
return Ce(n, void 0, void 0,
|
|
2068
|
+
return Ce(n, void 0, void 0, he().mark(function r() {
|
|
2068
2069
|
var n, i;
|
|
2069
|
-
return
|
|
2070
|
+
return he().wrap(function (r) {
|
|
2070
2071
|
for (;;) switch (r.prev = r.next) {
|
|
2071
2072
|
case 0:
|
|
2072
2073
|
return r.next = 2, this.executeRecaptcha();
|
|
@@ -2088,9 +2089,9 @@ var Ze = pe(function e(t, r) {
|
|
|
2088
2089
|
}));
|
|
2089
2090
|
},
|
|
2090
2091
|
send: function send(e, t) {
|
|
2091
|
-
return Ce(n, void 0, void 0,
|
|
2092
|
+
return Ce(n, void 0, void 0, he().mark(function r() {
|
|
2092
2093
|
var n, i, s, o;
|
|
2093
|
-
return
|
|
2094
|
+
return he().wrap(function (r) {
|
|
2094
2095
|
for (;;) switch (r.prev = r.next) {
|
|
2095
2096
|
case 0:
|
|
2096
2097
|
return r.next = 2, this.executeRecaptcha();
|
|
@@ -2112,12 +2113,12 @@ var Ze = pe(function e(t, r) {
|
|
|
2112
2113
|
}));
|
|
2113
2114
|
}
|
|
2114
2115
|
}, this.authenticate = function (e, t, r) {
|
|
2115
|
-
return Ce(n, void 0, void 0,
|
|
2116
|
+
return Ce(n, void 0, void 0, he().mark(function n() {
|
|
2116
2117
|
var i, s, o, a, c;
|
|
2117
|
-
return
|
|
2118
|
+
return he().wrap(function (n) {
|
|
2118
2119
|
for (;;) switch (n.prev = n.next) {
|
|
2119
2120
|
case 0:
|
|
2120
|
-
return
|
|
2121
|
+
return ze("stytch.otps.authenticate").isString("Code", e).isNumber("session_duration_minutes", r.session_duration_minutes), n.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
2121
2122
|
case 3:
|
|
2122
2123
|
return i = n.sent, s = i.dfp_telemetry_id, o = i.captcha_token, a = Object.assign({
|
|
2123
2124
|
token: e,
|
|
@@ -2149,9 +2150,9 @@ var Ze = pe(function e(t, r) {
|
|
|
2149
2150
|
}));
|
|
2150
2151
|
};
|
|
2151
2152
|
}),
|
|
2152
|
-
|
|
2153
|
+
it = function () {
|
|
2153
2154
|
function e(t, r, n, i, s) {
|
|
2154
|
-
|
|
2155
|
+
me(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._dynamicConfig = i, this._config = s, this.google = {
|
|
2155
2156
|
start: this.startOAuthFlow(exports.OAuthProviders.Google)
|
|
2156
2157
|
}, this.apple = {
|
|
2157
2158
|
start: this.startOAuthFlow(exports.OAuthProviders.Apple)
|
|
@@ -2191,17 +2192,17 @@ var Ze = pe(function e(t, r) {
|
|
|
2191
2192
|
start: this.startOAuthFlow(exports.OAuthProviders.Yahoo)
|
|
2192
2193
|
};
|
|
2193
2194
|
}
|
|
2194
|
-
return
|
|
2195
|
+
return fe(e, [{
|
|
2195
2196
|
key: "authenticate",
|
|
2196
2197
|
value: function value(e, t) {
|
|
2197
|
-
return Ce(this, void 0, void 0,
|
|
2198
|
+
return Ce(this, void 0, void 0, he().mark(function r() {
|
|
2198
2199
|
var n, i;
|
|
2199
|
-
return
|
|
2200
|
+
return he().wrap(function (r) {
|
|
2200
2201
|
for (;;) switch (r.prev = r.next) {
|
|
2201
2202
|
case 0:
|
|
2202
|
-
return
|
|
2203
|
+
return ze("stytch.oauth.authenticate").isString("Token", e).isNumber("session_duration_minutes", t.session_duration_minutes), r.next = 3, this._pkceManager.getPKPair();
|
|
2203
2204
|
case 3:
|
|
2204
|
-
return (n = r.sent) ||
|
|
2205
|
+
return (n = r.sent) || We("No code verifier found in local storage for OAuth flow.\nConsider using stytch.oauth.$provider.start() to add PKCE to your OAuth flows for added security.\nSee https://stytch.com/docs/oauth#guides_pkce for more information."), r.next = 7, this._networkClient.fetchSDK({
|
|
2205
2206
|
url: "/oauth/authenticate",
|
|
2206
2207
|
method: "POST",
|
|
2207
2208
|
body: Object.assign({
|
|
@@ -2214,7 +2215,7 @@ var Ze = pe(function e(t, r) {
|
|
|
2214
2215
|
return i = r.sent, this._pkceManager.clearPKPair(), this._subscriptionService.updateStateAndTokens({
|
|
2215
2216
|
state: {
|
|
2216
2217
|
session: i.session,
|
|
2217
|
-
user:
|
|
2218
|
+
user: Ve(i.__user)
|
|
2218
2219
|
},
|
|
2219
2220
|
session_token: i.session_token,
|
|
2220
2221
|
session_jwt: i.session_jwt,
|
|
@@ -2230,9 +2231,9 @@ var Ze = pe(function e(t, r) {
|
|
|
2230
2231
|
}, {
|
|
2231
2232
|
key: "getBaseApiUrl",
|
|
2232
2233
|
value: function value() {
|
|
2233
|
-
return Ce(this, void 0, void 0,
|
|
2234
|
+
return Ce(this, void 0, void 0, he().mark(function e() {
|
|
2234
2235
|
var t, r;
|
|
2235
|
-
return
|
|
2236
|
+
return he().wrap(function (e) {
|
|
2236
2237
|
for (;;) switch (e.prev = e.next) {
|
|
2237
2238
|
case 0:
|
|
2238
2239
|
return e.next = 2, this._dynamicConfig;
|
|
@@ -2267,9 +2268,9 @@ var Ze = pe(function e(t, r) {
|
|
|
2267
2268
|
i = r.signup_redirect_url,
|
|
2268
2269
|
s = r.custom_scopes,
|
|
2269
2270
|
o = r.provider_params;
|
|
2270
|
-
return Ce(t, void 0, void 0,
|
|
2271
|
+
return Ce(t, void 0, void 0, he().mark(function t() {
|
|
2271
2272
|
var r, a, c, u, l, d, h;
|
|
2272
|
-
return
|
|
2273
|
+
return he().wrap(function (t) {
|
|
2273
2274
|
for (;;) switch (t.prev = t.next) {
|
|
2274
2275
|
case 0:
|
|
2275
2276
|
return t.next = 2, this._dynamicConfig;
|
|
@@ -2296,7 +2297,7 @@ var Ze = pe(function e(t, r) {
|
|
|
2296
2297
|
case 18:
|
|
2297
2298
|
this._pkceManager.clearPKPair();
|
|
2298
2299
|
case 19:
|
|
2299
|
-
if (s && (
|
|
2300
|
+
if (s && (ze("startOAuthFlow").isStringArray("custom_scopes", s), l.searchParams.set("custom_scopes", s.join(" "))), o) for (h in ze("startOAuthFlow").isOptionalObject("provider_params", o), o) l.searchParams.set("provider_" + h, o[h]);
|
|
2300
2301
|
n && l.searchParams.set("login_redirect_url", n), i && l.searchParams.set("signup_redirect_url", i), window.location.href = l.toString();
|
|
2301
2302
|
case 24:
|
|
2302
2303
|
case "end":
|
|
@@ -2308,23 +2309,23 @@ var Ze = pe(function e(t, r) {
|
|
|
2308
2309
|
}
|
|
2309
2310
|
}]), e;
|
|
2310
2311
|
}(),
|
|
2311
|
-
|
|
2312
|
+
st = function () {
|
|
2312
2313
|
function e(t, r) {
|
|
2313
2314
|
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : function () {
|
|
2314
2315
|
return Promise.resolve(void 0);
|
|
2315
2316
|
},
|
|
2316
|
-
i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] :
|
|
2317
|
-
|
|
2317
|
+
i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : $e();
|
|
2318
|
+
me(this, e), this._networkClient = t, this._subscriptionService = r, this.executeRecaptcha = n, this.dfpProtectedAuth = i;
|
|
2318
2319
|
}
|
|
2319
|
-
return
|
|
2320
|
+
return fe(e, [{
|
|
2320
2321
|
key: "authenticateStart",
|
|
2321
2322
|
value: function value(e) {
|
|
2322
|
-
return Ce(this, void 0, void 0,
|
|
2323
|
+
return Ce(this, void 0, void 0, he().mark(function t() {
|
|
2323
2324
|
var r, n, i;
|
|
2324
|
-
return
|
|
2325
|
+
return he().wrap(function (t) {
|
|
2325
2326
|
for (;;) switch (t.prev = t.next) {
|
|
2326
2327
|
case 0:
|
|
2327
|
-
return
|
|
2328
|
+
return ze("stytch.cryptoWallets.authenticateStart").isString("crypto_wallet_address", e.crypto_wallet_address).isString("crypto_wallet_type", e.crypto_wallet_type), r = !!this._subscriptionService.getSession(), t.next = 4, this.executeRecaptcha();
|
|
2328
2329
|
case 4:
|
|
2329
2330
|
return n = t.sent, i = r ? "/crypto_wallets/authenticate/start/secondary" : "/crypto_wallets/authenticate/start/primary", t.abrupt("return", this._networkClient.fetchSDK({
|
|
2330
2331
|
url: i,
|
|
@@ -2346,12 +2347,12 @@ var Ze = pe(function e(t, r) {
|
|
|
2346
2347
|
}, {
|
|
2347
2348
|
key: "authenticate",
|
|
2348
2349
|
value: function value(e) {
|
|
2349
|
-
return Ce(this, void 0, void 0,
|
|
2350
|
+
return Ce(this, void 0, void 0, he().mark(function t() {
|
|
2350
2351
|
var r, n, i, s;
|
|
2351
|
-
return
|
|
2352
|
+
return he().wrap(function (t) {
|
|
2352
2353
|
for (;;) switch (t.prev = t.next) {
|
|
2353
2354
|
case 0:
|
|
2354
|
-
return
|
|
2355
|
+
return ze("stytch.cryptoWallets.authenticate").isString("signature", e.signature).isString("crypto_wallet_address", e.crypto_wallet_address).isString("crypto_wallet_type", e.crypto_wallet_type).isNumber("session_duration_minutes", e.session_duration_minutes), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
2355
2356
|
case 3:
|
|
2356
2357
|
return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._networkClient.retriableFetchSDK({
|
|
2357
2358
|
url: "/crypto_wallets/authenticate",
|
|
@@ -2371,7 +2372,7 @@ var Ze = pe(function e(t, r) {
|
|
|
2371
2372
|
return s = t.sent, this._subscriptionService.updateStateAndTokens({
|
|
2372
2373
|
state: {
|
|
2373
2374
|
session: s.session,
|
|
2374
|
-
user:
|
|
2375
|
+
user: Ve(s.__user)
|
|
2375
2376
|
},
|
|
2376
2377
|
session_token: s.session_token,
|
|
2377
2378
|
session_jwt: s.session_jwt,
|
|
@@ -2386,19 +2387,19 @@ var Ze = pe(function e(t, r) {
|
|
|
2386
2387
|
}
|
|
2387
2388
|
}]), e;
|
|
2388
2389
|
}(),
|
|
2389
|
-
|
|
2390
|
+
ot = function () {
|
|
2390
2391
|
function e(t, r, n) {
|
|
2391
|
-
|
|
2392
|
+
me(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = n;
|
|
2392
2393
|
}
|
|
2393
|
-
return
|
|
2394
|
+
return fe(e, [{
|
|
2394
2395
|
key: "create",
|
|
2395
2396
|
value: function value(e) {
|
|
2396
|
-
return Ce(this, void 0, void 0,
|
|
2397
|
+
return Ce(this, void 0, void 0, he().mark(function t() {
|
|
2397
2398
|
var r;
|
|
2398
|
-
return
|
|
2399
|
+
return he().wrap(function (t) {
|
|
2399
2400
|
for (;;) switch (t.prev = t.next) {
|
|
2400
2401
|
case 0:
|
|
2401
|
-
return
|
|
2402
|
+
return ze("stytch.totps.create").isNumber("expiration_minutes", e.expiration_minutes), t.next = 3, this._networkClient.fetchSDK({
|
|
2402
2403
|
url: "/totps",
|
|
2403
2404
|
method: "POST",
|
|
2404
2405
|
errorMessage: "Failed to create TOTP",
|
|
@@ -2418,12 +2419,12 @@ var Ze = pe(function e(t, r) {
|
|
|
2418
2419
|
}, {
|
|
2419
2420
|
key: "authenticate",
|
|
2420
2421
|
value: function value(e) {
|
|
2421
|
-
return Ce(this, void 0, void 0,
|
|
2422
|
+
return Ce(this, void 0, void 0, he().mark(function t() {
|
|
2422
2423
|
var r, n, i, s;
|
|
2423
|
-
return
|
|
2424
|
+
return he().wrap(function (t) {
|
|
2424
2425
|
for (;;) switch (t.prev = t.next) {
|
|
2425
2426
|
case 0:
|
|
2426
|
-
return
|
|
2427
|
+
return ze("stytch.totps.authenticate").isNumber("session_duration_minutes", e.session_duration_minutes).isString("totp_code", e.totp_code), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
2427
2428
|
case 3:
|
|
2428
2429
|
return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._networkClient.retriableFetchSDK({
|
|
2429
2430
|
url: "/totps/authenticate",
|
|
@@ -2457,8 +2458,8 @@ var Ze = pe(function e(t, r) {
|
|
|
2457
2458
|
}, {
|
|
2458
2459
|
key: "recoveryCodes",
|
|
2459
2460
|
value: function value() {
|
|
2460
|
-
return Ce(this, void 0, void 0,
|
|
2461
|
-
return
|
|
2461
|
+
return Ce(this, void 0, void 0, he().mark(function e() {
|
|
2462
|
+
return he().wrap(function (e) {
|
|
2462
2463
|
for (;;) switch (e.prev = e.next) {
|
|
2463
2464
|
case 0:
|
|
2464
2465
|
return e.abrupt("return", this._networkClient.fetchSDK({
|
|
@@ -2476,12 +2477,12 @@ var Ze = pe(function e(t, r) {
|
|
|
2476
2477
|
}, {
|
|
2477
2478
|
key: "recover",
|
|
2478
2479
|
value: function value(e) {
|
|
2479
|
-
return Ce(this, void 0, void 0,
|
|
2480
|
+
return Ce(this, void 0, void 0, he().mark(function t() {
|
|
2480
2481
|
var r, n, i, s;
|
|
2481
|
-
return
|
|
2482
|
+
return he().wrap(function (t) {
|
|
2482
2483
|
for (;;) switch (t.prev = t.next) {
|
|
2483
2484
|
case 0:
|
|
2484
|
-
return
|
|
2485
|
+
return ze("stytch.totps.recover").isNumber("session_duration_minutes", e.session_duration_minutes).isString("recovery_code", e.recovery_code), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
2485
2486
|
case 3:
|
|
2486
2487
|
return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._networkClient.retriableFetchSDK({
|
|
2487
2488
|
url: "/totps/recover",
|
|
@@ -2514,14 +2515,14 @@ var Ze = pe(function e(t, r) {
|
|
|
2514
2515
|
}
|
|
2515
2516
|
}]), e;
|
|
2516
2517
|
}();
|
|
2517
|
-
function
|
|
2518
|
+
function at(e) {
|
|
2518
2519
|
for (var t = "==".slice(0, (4 - e.length % 4) % 4), r = e.replace(/-/g, "+").replace(/_/g, "/") + t, n = atob(r), i = new ArrayBuffer(n.length), s = new Uint8Array(i), o = 0; o < n.length; o++) s[o] = n.charCodeAt(o);
|
|
2519
2520
|
return i;
|
|
2520
2521
|
}
|
|
2521
|
-
function
|
|
2522
|
+
function ct(e) {
|
|
2522
2523
|
var t,
|
|
2523
2524
|
r = "",
|
|
2524
|
-
n =
|
|
2525
|
+
n = ae(new Uint8Array(e));
|
|
2525
2526
|
try {
|
|
2526
2527
|
for (n.s(); !(t = n.n()).done;) {
|
|
2527
2528
|
var i = t.value;
|
|
@@ -2534,139 +2535,139 @@ function at(e) {
|
|
|
2534
2535
|
}
|
|
2535
2536
|
return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
2536
2537
|
}
|
|
2537
|
-
var
|
|
2538
|
-
|
|
2539
|
-
function
|
|
2540
|
-
if (t ===
|
|
2541
|
-
if (t ===
|
|
2538
|
+
var ut = "copy",
|
|
2539
|
+
lt = "convert";
|
|
2540
|
+
function dt(e, t, r) {
|
|
2541
|
+
if (t === ut) return r;
|
|
2542
|
+
if (t === lt) return e(r);
|
|
2542
2543
|
if (t instanceof Array) return r.map(function (r) {
|
|
2543
|
-
return
|
|
2544
|
+
return dt(e, t[0], r);
|
|
2544
2545
|
});
|
|
2545
2546
|
if (t instanceof Object) {
|
|
2546
2547
|
for (var n = {}, i = 0, s = Object.entries(t); i < s.length; i++) {
|
|
2547
|
-
var o =
|
|
2548
|
+
var o = ce(s[i], 2),
|
|
2548
2549
|
a = o[0],
|
|
2549
2550
|
c = o[1];
|
|
2550
2551
|
if (c.derive) {
|
|
2551
2552
|
var u = c.derive(r);
|
|
2552
2553
|
void 0 !== u && (r[a] = u);
|
|
2553
2554
|
}
|
|
2554
|
-
if (a in r) null != r[a] ? n[a] =
|
|
2555
|
+
if (a in r) null != r[a] ? n[a] = dt(e, c.schema, r[a]) : n[a] = null;else if (c.required) throw new Error("Missing key: ".concat(a));
|
|
2555
2556
|
}
|
|
2556
2557
|
return n;
|
|
2557
2558
|
}
|
|
2558
2559
|
}
|
|
2559
|
-
function
|
|
2560
|
+
function ht(e, t) {
|
|
2560
2561
|
return {
|
|
2561
2562
|
required: !0,
|
|
2562
2563
|
schema: e,
|
|
2563
2564
|
derive: t
|
|
2564
2565
|
};
|
|
2565
2566
|
}
|
|
2566
|
-
function
|
|
2567
|
+
function pt(e) {
|
|
2567
2568
|
return {
|
|
2568
2569
|
required: !0,
|
|
2569
2570
|
schema: e
|
|
2570
2571
|
};
|
|
2571
2572
|
}
|
|
2572
|
-
function
|
|
2573
|
+
function ft(e) {
|
|
2573
2574
|
return {
|
|
2574
2575
|
required: !1,
|
|
2575
2576
|
schema: e
|
|
2576
2577
|
};
|
|
2577
2578
|
}
|
|
2578
|
-
var
|
|
2579
|
-
type:
|
|
2580
|
-
id:
|
|
2581
|
-
transports:
|
|
2582
|
-
},
|
|
2583
|
-
_t = {
|
|
2584
|
-
appid: pt(ct),
|
|
2585
|
-
appidExclude: pt(ct),
|
|
2586
|
-
credProps: pt(ct)
|
|
2579
|
+
var _t = {
|
|
2580
|
+
type: pt(ut),
|
|
2581
|
+
id: pt(lt),
|
|
2582
|
+
transports: ft(ut)
|
|
2587
2583
|
},
|
|
2588
2584
|
mt = {
|
|
2589
|
-
appid:
|
|
2590
|
-
appidExclude:
|
|
2591
|
-
credProps:
|
|
2585
|
+
appid: ft(ut),
|
|
2586
|
+
appidExclude: ft(ut),
|
|
2587
|
+
credProps: ft(ut)
|
|
2592
2588
|
},
|
|
2593
2589
|
vt = {
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2590
|
+
appid: ft(ut),
|
|
2591
|
+
appidExclude: ft(ut),
|
|
2592
|
+
credProps: ft(ut)
|
|
2593
|
+
},
|
|
2594
|
+
yt = {
|
|
2595
|
+
publicKey: pt({
|
|
2596
|
+
rp: pt(ut),
|
|
2597
|
+
user: pt({
|
|
2598
|
+
id: pt(lt),
|
|
2599
|
+
name: pt(ut),
|
|
2600
|
+
displayName: pt(ut)
|
|
2600
2601
|
}),
|
|
2601
|
-
challenge:
|
|
2602
|
-
pubKeyCredParams:
|
|
2603
|
-
timeout:
|
|
2604
|
-
excludeCredentials:
|
|
2605
|
-
authenticatorSelection:
|
|
2606
|
-
attestation:
|
|
2607
|
-
extensions:
|
|
2602
|
+
challenge: pt(lt),
|
|
2603
|
+
pubKeyCredParams: pt(ut),
|
|
2604
|
+
timeout: ft(ut),
|
|
2605
|
+
excludeCredentials: ft([_t]),
|
|
2606
|
+
authenticatorSelection: ft(ut),
|
|
2607
|
+
attestation: ft(ut),
|
|
2608
|
+
extensions: ft(mt)
|
|
2608
2609
|
}),
|
|
2609
|
-
signal:
|
|
2610
|
+
signal: ft(ut)
|
|
2610
2611
|
},
|
|
2611
|
-
|
|
2612
|
-
type:
|
|
2613
|
-
id:
|
|
2614
|
-
rawId:
|
|
2615
|
-
authenticatorAttachment:
|
|
2616
|
-
response:
|
|
2617
|
-
clientDataJSON:
|
|
2618
|
-
attestationObject:
|
|
2619
|
-
transports:
|
|
2612
|
+
gt = {
|
|
2613
|
+
type: pt(ut),
|
|
2614
|
+
id: pt(ut),
|
|
2615
|
+
rawId: pt(lt),
|
|
2616
|
+
authenticatorAttachment: ft(ut),
|
|
2617
|
+
response: pt({
|
|
2618
|
+
clientDataJSON: pt(lt),
|
|
2619
|
+
attestationObject: pt(lt),
|
|
2620
|
+
transports: ht(ut, function (e) {
|
|
2620
2621
|
var t;
|
|
2621
2622
|
return (null == (t = e.getTransports) ? void 0 : t.call(e)) || [];
|
|
2622
2623
|
})
|
|
2623
2624
|
}),
|
|
2624
|
-
clientExtensionResults:
|
|
2625
|
+
clientExtensionResults: ht(vt, function (e) {
|
|
2625
2626
|
return e.getClientExtensionResults();
|
|
2626
2627
|
})
|
|
2627
2628
|
},
|
|
2628
|
-
|
|
2629
|
-
mediation:
|
|
2630
|
-
publicKey:
|
|
2631
|
-
challenge:
|
|
2632
|
-
timeout:
|
|
2633
|
-
rpId:
|
|
2634
|
-
allowCredentials:
|
|
2635
|
-
userVerification:
|
|
2636
|
-
extensions:
|
|
2629
|
+
bt = {
|
|
2630
|
+
mediation: ft(ut),
|
|
2631
|
+
publicKey: pt({
|
|
2632
|
+
challenge: pt(lt),
|
|
2633
|
+
timeout: ft(ut),
|
|
2634
|
+
rpId: ft(ut),
|
|
2635
|
+
allowCredentials: ft([_t]),
|
|
2636
|
+
userVerification: ft(ut),
|
|
2637
|
+
extensions: ft(mt)
|
|
2637
2638
|
}),
|
|
2638
|
-
signal:
|
|
2639
|
+
signal: ft(ut)
|
|
2639
2640
|
},
|
|
2640
|
-
|
|
2641
|
-
type:
|
|
2642
|
-
id:
|
|
2643
|
-
rawId:
|
|
2644
|
-
authenticatorAttachment:
|
|
2645
|
-
response:
|
|
2646
|
-
clientDataJSON:
|
|
2647
|
-
authenticatorData:
|
|
2648
|
-
signature:
|
|
2649
|
-
userHandle:
|
|
2641
|
+
kt = {
|
|
2642
|
+
type: pt(ut),
|
|
2643
|
+
id: pt(ut),
|
|
2644
|
+
rawId: pt(lt),
|
|
2645
|
+
authenticatorAttachment: ft(ut),
|
|
2646
|
+
response: pt({
|
|
2647
|
+
clientDataJSON: pt(lt),
|
|
2648
|
+
authenticatorData: pt(lt),
|
|
2649
|
+
signature: pt(lt),
|
|
2650
|
+
userHandle: pt(lt)
|
|
2650
2651
|
}),
|
|
2651
|
-
clientExtensionResults:
|
|
2652
|
+
clientExtensionResults: ht(vt, function (e) {
|
|
2652
2653
|
return e.getClientExtensionResults();
|
|
2653
2654
|
})
|
|
2654
2655
|
};
|
|
2655
|
-
function kt(e) {
|
|
2656
|
-
return lt(ot, vt, e);
|
|
2657
|
-
}
|
|
2658
2656
|
function wt(e) {
|
|
2659
|
-
return
|
|
2657
|
+
return dt(at, yt, e);
|
|
2660
2658
|
}
|
|
2661
2659
|
function St(e) {
|
|
2662
|
-
return
|
|
2660
|
+
return dt(ct, gt, e);
|
|
2661
|
+
}
|
|
2662
|
+
function xt(e) {
|
|
2663
|
+
return Ce(this, void 0, void 0, he().mark(function t() {
|
|
2663
2664
|
var r;
|
|
2664
|
-
return
|
|
2665
|
+
return he().wrap(function (t) {
|
|
2665
2666
|
for (;;) switch (t.prev = t.next) {
|
|
2666
2667
|
case 0:
|
|
2667
|
-
return t.next = 2, navigator.credentials.create(
|
|
2668
|
+
return t.next = 2, navigator.credentials.create(wt(e));
|
|
2668
2669
|
case 2:
|
|
2669
|
-
return r = t.sent, t.abrupt("return",
|
|
2670
|
+
return r = t.sent, t.abrupt("return", St(r));
|
|
2670
2671
|
case 4:
|
|
2671
2672
|
case "end":
|
|
2672
2673
|
return t.stop();
|
|
@@ -2674,19 +2675,19 @@ function St(e) {
|
|
|
2674
2675
|
}, t);
|
|
2675
2676
|
}));
|
|
2676
2677
|
}
|
|
2677
|
-
function
|
|
2678
|
-
return
|
|
2678
|
+
function Pt(e) {
|
|
2679
|
+
return dt(at, bt, e);
|
|
2679
2680
|
}
|
|
2680
2681
|
function Ct(e) {
|
|
2681
|
-
return
|
|
2682
|
+
return dt(ct, kt, e);
|
|
2682
2683
|
}
|
|
2683
|
-
function
|
|
2684
|
-
return Ce(this, void 0, void 0,
|
|
2684
|
+
function Ot(e) {
|
|
2685
|
+
return Ce(this, void 0, void 0, he().mark(function t() {
|
|
2685
2686
|
var r;
|
|
2686
|
-
return
|
|
2687
|
+
return he().wrap(function (t) {
|
|
2687
2688
|
for (;;) switch (t.prev = t.next) {
|
|
2688
2689
|
case 0:
|
|
2689
|
-
return t.next = 2, navigator.credentials.get(
|
|
2690
|
+
return t.next = 2, navigator.credentials.get(Pt(e));
|
|
2690
2691
|
case 2:
|
|
2691
2692
|
return r = t.sent, t.abrupt("return", Ct(r));
|
|
2692
2693
|
case 4:
|
|
@@ -2696,22 +2697,22 @@ function Pt(e) {
|
|
|
2696
2697
|
}, t);
|
|
2697
2698
|
}));
|
|
2698
2699
|
}
|
|
2699
|
-
var
|
|
2700
|
+
var Tt = function () {
|
|
2700
2701
|
function e(t, r, n) {
|
|
2701
|
-
|
|
2702
|
+
me(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = n, this.checkEligibleInputs = function () {
|
|
2702
2703
|
return !(document.querySelectorAll("input[autocomplete*='webauthn']").length < 1) || (console.error('No <input> with `"webauthn"` in its `autocomplete` attribute was detected'), !1);
|
|
2703
2704
|
};
|
|
2704
2705
|
}
|
|
2705
|
-
return
|
|
2706
|
+
return fe(e, [{
|
|
2706
2707
|
key: "register",
|
|
2707
2708
|
value: function value(e) {
|
|
2708
2709
|
var t, r;
|
|
2709
|
-
return Ce(this, void 0, void 0,
|
|
2710
|
+
return Ce(this, void 0, void 0, he().mark(function n() {
|
|
2710
2711
|
var i, s, o, a, c;
|
|
2711
|
-
return
|
|
2712
|
+
return he().wrap(function (n) {
|
|
2712
2713
|
for (;;) switch (n.prev = n.next) {
|
|
2713
2714
|
case 0:
|
|
2714
|
-
return
|
|
2715
|
+
return ze("stytch.webauthn.register").isOptionalString("domain", null == e ? void 0 : e.domain).isOptionalString("authenticator_type", null == e ? void 0 : e.authenticator_type).isOptionalBoolean("is_passkey", null == e ? void 0 : e.is_passkey).isOptionalNumber("session_duration_minutes", null == e ? void 0 : e.session_duration_minutes), n.next = 3, this._networkClient.fetchSDK({
|
|
2715
2716
|
url: "/webauthn/register/start",
|
|
2716
2717
|
method: "POST",
|
|
2717
2718
|
errorMessage: "Failed to start WebAuthn registration",
|
|
@@ -2723,7 +2724,7 @@ var Ot = function () {
|
|
|
2723
2724
|
}
|
|
2724
2725
|
});
|
|
2725
2726
|
case 3:
|
|
2726
|
-
return i = n.sent, s = i.public_key_credential_creation_options, o = JSON.parse(s), n.next = 8,
|
|
2727
|
+
return i = n.sent, s = i.public_key_credential_creation_options, o = JSON.parse(s), n.next = 8, xt({
|
|
2727
2728
|
publicKey: o
|
|
2728
2729
|
});
|
|
2729
2730
|
case 8:
|
|
@@ -2757,12 +2758,12 @@ var Ot = function () {
|
|
|
2757
2758
|
key: "authenticate",
|
|
2758
2759
|
value: function value(e) {
|
|
2759
2760
|
var t, r;
|
|
2760
|
-
return Ce(this, void 0, void 0,
|
|
2761
|
+
return Ce(this, void 0, void 0, he().mark(function n() {
|
|
2761
2762
|
var i, s, o, a, c, u, l, d, h, p, f, _;
|
|
2762
|
-
return
|
|
2763
|
+
return he().wrap(function (n) {
|
|
2763
2764
|
for (;;) switch (n.prev = n.next) {
|
|
2764
2765
|
case 0:
|
|
2765
|
-
return
|
|
2766
|
+
return ze("stytch.webauthn.authenticate").isOptionalString("domain", e.domain).isNumber("session_duration_minutes", e.session_duration_minutes).isOptionalBoolean("is_passkey", e.is_passkey).isOptionalObject("signal", e.signal), n.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
2766
2767
|
case 3:
|
|
2767
2768
|
if (i = n.sent, s = i.dfp_telemetry_id, o = i.captcha_token, !e.conditional_mediation) {
|
|
2768
2769
|
n.next = 14;
|
|
@@ -2797,7 +2798,7 @@ var Ot = function () {
|
|
|
2797
2798
|
signal: null !== (r = e.signal) && void 0 !== r ? r : d.signal
|
|
2798
2799
|
}, p = Object.assign(Object.assign({}, h), {
|
|
2799
2800
|
mediation: "conditional"
|
|
2800
|
-
}), n.next = 25,
|
|
2801
|
+
}), n.next = 25, Ot(e.conditional_mediation ? p : h);
|
|
2801
2802
|
case 25:
|
|
2802
2803
|
return f = n.sent, n.next = 28, this._networkClient.retriableFetchSDK({
|
|
2803
2804
|
url: "/webauthn/authenticate",
|
|
@@ -2831,9 +2832,9 @@ var Ot = function () {
|
|
|
2831
2832
|
}, {
|
|
2832
2833
|
key: "update",
|
|
2833
2834
|
value: function value(e) {
|
|
2834
|
-
return Ce(this, void 0, void 0,
|
|
2835
|
+
return Ce(this, void 0, void 0, he().mark(function t() {
|
|
2835
2836
|
var r;
|
|
2836
|
-
return
|
|
2837
|
+
return he().wrap(function (t) {
|
|
2837
2838
|
for (;;) switch (t.prev = t.next) {
|
|
2838
2839
|
case 0:
|
|
2839
2840
|
return r = "/webauthn/update/" + e.webauthn_registration_id, t.next = 3, this._networkClient.fetchSDK({
|
|
@@ -2856,9 +2857,9 @@ var Ot = function () {
|
|
|
2856
2857
|
}, {
|
|
2857
2858
|
key: "browserSupportsAutofill",
|
|
2858
2859
|
value: function value() {
|
|
2859
|
-
return Ce(this, void 0, void 0,
|
|
2860
|
+
return Ce(this, void 0, void 0, he().mark(function e() {
|
|
2860
2861
|
var t;
|
|
2861
|
-
return
|
|
2862
|
+
return he().wrap(function (e) {
|
|
2862
2863
|
for (;;) switch (e.prev = e.next) {
|
|
2863
2864
|
case 0:
|
|
2864
2865
|
if (void 0 !== (t = window.PublicKeyCredential) && void 0 !== t.isConditionalMediationAvailable) {
|
|
@@ -2882,18 +2883,18 @@ var Ot = function () {
|
|
|
2882
2883
|
At = Promise.resolve({
|
|
2883
2884
|
pkceRequiredForPasswordResets: !1
|
|
2884
2885
|
}),
|
|
2885
|
-
|
|
2886
|
+
Et = function () {
|
|
2886
2887
|
function e(t, r, n) {
|
|
2887
2888
|
var i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : At,
|
|
2888
|
-
s = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] :
|
|
2889
|
-
|
|
2889
|
+
s = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : $e();
|
|
2890
|
+
me(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._config = i, this.dfpProtectedAuth = s;
|
|
2890
2891
|
}
|
|
2891
|
-
return
|
|
2892
|
+
return fe(e, [{
|
|
2892
2893
|
key: "getCodeChallenge",
|
|
2893
2894
|
value: function value() {
|
|
2894
|
-
return Ce(this, void 0, void 0,
|
|
2895
|
+
return Ce(this, void 0, void 0, he().mark(function e() {
|
|
2895
2896
|
var t, r;
|
|
2896
|
-
return
|
|
2897
|
+
return he().wrap(function (e) {
|
|
2897
2898
|
for (;;) switch (e.prev = e.next) {
|
|
2898
2899
|
case 0:
|
|
2899
2900
|
return e.next = 2, this._config;
|
|
@@ -2925,12 +2926,12 @@ var Ot = function () {
|
|
|
2925
2926
|
}, {
|
|
2926
2927
|
key: "create",
|
|
2927
2928
|
value: function value(e) {
|
|
2928
|
-
return Ce(this, void 0, void 0,
|
|
2929
|
+
return Ce(this, void 0, void 0, he().mark(function t() {
|
|
2929
2930
|
var r, n, i, s;
|
|
2930
|
-
return
|
|
2931
|
+
return he().wrap(function (t) {
|
|
2931
2932
|
for (;;) switch (t.prev = t.next) {
|
|
2932
2933
|
case 0:
|
|
2933
|
-
return
|
|
2934
|
+
return ze("stytch.passwords.create").isString("password", e.password).isString("email", e.email).isNumber("session_duration_minutes", e.session_duration_minutes), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
2934
2935
|
case 3:
|
|
2935
2936
|
return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._networkClient.retriableFetchSDK({
|
|
2936
2937
|
url: "/passwords",
|
|
@@ -2965,12 +2966,12 @@ var Ot = function () {
|
|
|
2965
2966
|
}, {
|
|
2966
2967
|
key: "authenticate",
|
|
2967
2968
|
value: function value(e) {
|
|
2968
|
-
return Ce(this, void 0, void 0,
|
|
2969
|
+
return Ce(this, void 0, void 0, he().mark(function t() {
|
|
2969
2970
|
var r, n, i, s;
|
|
2970
|
-
return
|
|
2971
|
+
return he().wrap(function (t) {
|
|
2971
2972
|
for (;;) switch (t.prev = t.next) {
|
|
2972
2973
|
case 0:
|
|
2973
|
-
return
|
|
2974
|
+
return ze("stytch.passwords.authenticate").isString("password", e.password).isString("email", e.email).isNumber("session_duration_minutes", e.session_duration_minutes), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
2974
2975
|
case 3:
|
|
2975
2976
|
return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._networkClient.retriableFetchSDK({
|
|
2976
2977
|
url: "/passwords/authenticate",
|
|
@@ -3005,12 +3006,12 @@ var Ot = function () {
|
|
|
3005
3006
|
}, {
|
|
3006
3007
|
key: "resetByEmailStart",
|
|
3007
3008
|
value: function value(e) {
|
|
3008
|
-
return Ce(this, void 0, void 0,
|
|
3009
|
+
return Ce(this, void 0, void 0, he().mark(function t() {
|
|
3009
3010
|
var r, n, i, s;
|
|
3010
|
-
return
|
|
3011
|
+
return he().wrap(function (t) {
|
|
3011
3012
|
for (;;) switch (t.prev = t.next) {
|
|
3012
3013
|
case 0:
|
|
3013
|
-
return
|
|
3014
|
+
return ze("stytch.passwords.resetByEmailStart").isString("email", e.email).isOptionalString("login_redirect_url", e.login_redirect_url).isOptionalString("reset_password_redirect_url", e.reset_password_redirect_url).isOptionalString("reset_password_template_id", e.reset_password_template_id).isOptionalNumber("reset_password_expiration_minutes", e.reset_password_expiration_minutes), t.next = 3, this.getCodeChallenge();
|
|
3014
3015
|
case 3:
|
|
3015
3016
|
return r = t.sent, t.next = 6, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
3016
3017
|
case 6:
|
|
@@ -3040,12 +3041,12 @@ var Ot = function () {
|
|
|
3040
3041
|
}, {
|
|
3041
3042
|
key: "resetByEmail",
|
|
3042
3043
|
value: function value(e) {
|
|
3043
|
-
return Ce(this, void 0, void 0,
|
|
3044
|
+
return Ce(this, void 0, void 0, he().mark(function t() {
|
|
3044
3045
|
var r, n, i, s, o, a;
|
|
3045
|
-
return
|
|
3046
|
+
return he().wrap(function (t) {
|
|
3046
3047
|
for (;;) switch (t.prev = t.next) {
|
|
3047
3048
|
case 0:
|
|
3048
|
-
return
|
|
3049
|
+
return ze("stytch.passwords.resetByEmail").isString("token", e.token).isString("password", e.password).isNumber("session_duration_minutes", e.session_duration_minutes), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
3049
3050
|
case 3:
|
|
3050
3051
|
return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._pkceManager.getPKPair();
|
|
3051
3052
|
case 8:
|
|
@@ -3083,12 +3084,12 @@ var Ot = function () {
|
|
|
3083
3084
|
}, {
|
|
3084
3085
|
key: "resetByExistingPassword",
|
|
3085
3086
|
value: function value(e) {
|
|
3086
|
-
return Ce(this, void 0, void 0,
|
|
3087
|
+
return Ce(this, void 0, void 0, he().mark(function t() {
|
|
3087
3088
|
var r, n, i, s;
|
|
3088
|
-
return
|
|
3089
|
+
return he().wrap(function (t) {
|
|
3089
3090
|
for (;;) switch (t.prev = t.next) {
|
|
3090
3091
|
case 0:
|
|
3091
|
-
return
|
|
3092
|
+
return ze("stytch.passwords.resetByExistingPassword").isString("email", e.email).isString("existing_password", e.existing_password).isString("new_password", e.new_password).isNumber("session_duration_minutes", e.session_duration_minutes), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
3092
3093
|
case 3:
|
|
3093
3094
|
return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._networkClient.retriableFetchSDK({
|
|
3094
3095
|
url: "/passwords/existing_password/reset",
|
|
@@ -3124,12 +3125,12 @@ var Ot = function () {
|
|
|
3124
3125
|
}, {
|
|
3125
3126
|
key: "resetBySession",
|
|
3126
3127
|
value: function value(e) {
|
|
3127
|
-
return Ce(this, void 0, void 0,
|
|
3128
|
+
return Ce(this, void 0, void 0, he().mark(function t() {
|
|
3128
3129
|
var r, n, i, s;
|
|
3129
|
-
return
|
|
3130
|
+
return he().wrap(function (t) {
|
|
3130
3131
|
for (;;) switch (t.prev = t.next) {
|
|
3131
3132
|
case 0:
|
|
3132
|
-
return
|
|
3133
|
+
return ze("stytch.passwords.resetBySession").isString("password", e.password), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
3133
3134
|
case 3:
|
|
3134
3135
|
return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._networkClient.retriableFetchSDK({
|
|
3135
3136
|
url: "/passwords/session/reset",
|
|
@@ -3163,11 +3164,11 @@ var Ot = function () {
|
|
|
3163
3164
|
}, {
|
|
3164
3165
|
key: "strengthCheck",
|
|
3165
3166
|
value: function value(e) {
|
|
3166
|
-
return Ce(this, void 0, void 0,
|
|
3167
|
-
return
|
|
3167
|
+
return Ce(this, void 0, void 0, he().mark(function t() {
|
|
3168
|
+
return he().wrap(function (t) {
|
|
3168
3169
|
for (;;) switch (t.prev = t.next) {
|
|
3169
3170
|
case 0:
|
|
3170
|
-
return
|
|
3171
|
+
return ze("stytch.passwords.strengthCheck").isOptionalString("email", e.email).isString("password", e.password), t.abrupt("return", this._networkClient.fetchSDK({
|
|
3171
3172
|
url: "/passwords/strength_check",
|
|
3172
3173
|
method: "POST",
|
|
3173
3174
|
errorMessage: "Failed to check password strength.",
|
|
@@ -3190,15 +3191,15 @@ Promise.resolve({
|
|
|
3190
3191
|
}), Promise.resolve({
|
|
3191
3192
|
pkceRequiredForPasswordResets: !1
|
|
3192
3193
|
});
|
|
3193
|
-
var
|
|
3194
|
+
var Dt = function () {
|
|
3194
3195
|
function e(t) {
|
|
3195
|
-
|
|
3196
|
+
me(this, e), this.iframeURL = t, this.createIframe();
|
|
3196
3197
|
}
|
|
3197
|
-
return
|
|
3198
|
+
return fe(e, [{
|
|
3198
3199
|
key: "createIframe",
|
|
3199
3200
|
value: function value() {
|
|
3200
3201
|
var e = document.querySelector('[src~="'.concat(this.iframeURL, '"]'));
|
|
3201
|
-
e ?
|
|
3202
|
+
e ? We("It looks like you're creating multiple copies of the Stytch client. This behavior is unsupported, and unintended side effects may occur. Make sure you are creating the Stytch client at the global level, and not inside a component's render function.") : ((e = document.createElement("iframe")).src = this.iframeURL, e.style.position = "absolute", e.style.width = "0", e.style.height = "0", e.style.border = "0", document.body.appendChild(e)), "true" !== e.dataset.loaded ? this.frame = new Promise(function (t) {
|
|
3202
3203
|
e.addEventListener("load", function () {
|
|
3203
3204
|
e.dataset.loaded = "true", t(e);
|
|
3204
3205
|
}, {
|
|
@@ -3209,11 +3210,11 @@ var Et = function () {
|
|
|
3209
3210
|
}, {
|
|
3210
3211
|
key: "call",
|
|
3211
3212
|
value: function value(e, t) {
|
|
3212
|
-
return Ce(this, void 0, void 0,
|
|
3213
|
+
return Ce(this, void 0, void 0, he().mark(function r() {
|
|
3213
3214
|
var n,
|
|
3214
3215
|
i,
|
|
3215
3216
|
s = this;
|
|
3216
|
-
return
|
|
3217
|
+
return he().wrap(function (r) {
|
|
3217
3218
|
for (;;) switch (r.prev = r.next) {
|
|
3218
3219
|
case 0:
|
|
3219
3220
|
return r.next = 2, this.frame;
|
|
@@ -3222,7 +3223,7 @@ var Et = function () {
|
|
|
3222
3223
|
var a;
|
|
3223
3224
|
i.port1.onmessage = function (e) {
|
|
3224
3225
|
var t = e.data;
|
|
3225
|
-
i.port1.close(), t.success ? r(t.payload) : o(
|
|
3226
|
+
i.port1.close(), t.success ? r(t.payload) : o(Xe.unmarshall(t.error));
|
|
3226
3227
|
};
|
|
3227
3228
|
var c = {
|
|
3228
3229
|
method: e,
|
|
@@ -3239,15 +3240,15 @@ var Et = function () {
|
|
|
3239
3240
|
}
|
|
3240
3241
|
}]), e;
|
|
3241
3242
|
}(),
|
|
3242
|
-
|
|
3243
|
+
Rt = function () {
|
|
3243
3244
|
function e(t, r) {
|
|
3244
3245
|
var n = this;
|
|
3245
|
-
|
|
3246
|
+
me(this, e), this._subscriptionService = t, this._headlessSessionClient = r, this._onDataChange = function (e) {
|
|
3246
3247
|
(null == e ? void 0 : e.session) ? n.scheduleBackgroundRefresh() : n.cancelBackgroundRefresh();
|
|
3247
3248
|
}, this._reauthenticateWithBackoff = function () {
|
|
3248
|
-
return Ce(n, void 0, void 0,
|
|
3249
|
+
return Ce(n, void 0, void 0, he().mark(function t() {
|
|
3249
3250
|
var r;
|
|
3250
|
-
return
|
|
3251
|
+
return he().wrap(function (t) {
|
|
3251
3252
|
for (;;) switch (t.prev = t.next) {
|
|
3252
3253
|
case 0:
|
|
3253
3254
|
r = 0;
|
|
@@ -3276,14 +3277,14 @@ var Et = function () {
|
|
|
3276
3277
|
}));
|
|
3277
3278
|
}, this.timeout = null, this._subscriptionService.subscribeToState(this._onDataChange);
|
|
3278
3279
|
}
|
|
3279
|
-
return
|
|
3280
|
+
return fe(e, [{
|
|
3280
3281
|
key: "performBackgroundRefresh",
|
|
3281
3282
|
value: function value() {
|
|
3282
3283
|
var e = this;
|
|
3283
3284
|
this._reauthenticateWithBackoff().then(function () {
|
|
3284
3285
|
e.scheduleBackgroundRefresh();
|
|
3285
3286
|
})["catch"](function (t) {
|
|
3286
|
-
|
|
3287
|
+
We("Session background refresh failed. Signalling to app that user is logged out.", {
|
|
3287
3288
|
error: t
|
|
3288
3289
|
}), e._subscriptionService.destroySession();
|
|
3289
3290
|
});
|
|
@@ -3313,20 +3314,20 @@ var Et = function () {
|
|
|
3313
3314
|
}
|
|
3314
3315
|
}]), e;
|
|
3315
3316
|
}();
|
|
3316
|
-
|
|
3317
|
-
var
|
|
3318
|
-
var
|
|
3319
|
-
function
|
|
3317
|
+
Rt.REFRESH_INTERVAL_MS = 18e4;
|
|
3318
|
+
var It = "bootstrap";
|
|
3319
|
+
var Ft = /*#__PURE__*/function () {
|
|
3320
|
+
function Ft(e, t, r) {
|
|
3320
3321
|
var _this = this;
|
|
3321
|
-
_classCallCheck(this,
|
|
3322
|
+
_classCallCheck(this, Ft);
|
|
3322
3323
|
this._publicToken = e, this._networkClient = t, this._dataLayer = r, this._bootstrapDataPromise = this._networkClient.fetchSDK({
|
|
3323
3324
|
url: "/projects/bootstrap/".concat(this._publicToken),
|
|
3324
3325
|
method: "GET",
|
|
3325
3326
|
errorMessage: "Error fetching bootstrap data for SDK for ".concat(this._publicToken)
|
|
3326
|
-
}).then(
|
|
3327
|
-
return _this._dataLayer.setItem(
|
|
3327
|
+
}).then(Ft.mapBootstrapData).then(function (e) {
|
|
3328
|
+
return _this._dataLayer.setItem(It, JSON.stringify(e)), e;
|
|
3328
3329
|
})["catch"](function (e) {
|
|
3329
|
-
return
|
|
3330
|
+
return Ge(e), {
|
|
3330
3331
|
displayWatermark: !1,
|
|
3331
3332
|
cnameDomain: null,
|
|
3332
3333
|
emailDomains: ["stytch.com"],
|
|
@@ -3345,10 +3346,10 @@ var It = /*#__PURE__*/function () {
|
|
|
3345
3346
|
};
|
|
3346
3347
|
});
|
|
3347
3348
|
}
|
|
3348
|
-
_createClass(
|
|
3349
|
+
_createClass(Ft, [{
|
|
3349
3350
|
key: "getSync",
|
|
3350
3351
|
value: function getSync() {
|
|
3351
|
-
var e = this._dataLayer.getItem(
|
|
3352
|
+
var e = this._dataLayer.getItem(It);
|
|
3352
3353
|
if (null === e) return {
|
|
3353
3354
|
displayWatermark: !1,
|
|
3354
3355
|
cnameDomain: null,
|
|
@@ -3419,9 +3420,9 @@ var It = /*#__PURE__*/function () {
|
|
|
3419
3420
|
};
|
|
3420
3421
|
}
|
|
3421
3422
|
}]);
|
|
3422
|
-
return
|
|
3423
|
+
return Ft;
|
|
3423
3424
|
}();
|
|
3424
|
-
function
|
|
3425
|
+
function jt(e, t, r, n) {
|
|
3425
3426
|
return new (r || (r = Promise))(function (i, s) {
|
|
3426
3427
|
function o(e) {
|
|
3427
3428
|
try {
|
|
@@ -3447,11 +3448,11 @@ function Ft(e, t, r, n) {
|
|
|
3447
3448
|
});
|
|
3448
3449
|
}
|
|
3449
3450
|
"function" == typeof SuppressedError && SuppressedError;
|
|
3450
|
-
var
|
|
3451
|
+
var Bt = /*#__PURE__*/_createClass(function Bt(e) {
|
|
3451
3452
|
var _this2 = this;
|
|
3452
|
-
_classCallCheck(this,
|
|
3453
|
+
_classCallCheck(this, Bt);
|
|
3453
3454
|
this.bootstrapPromise = e, this.executeRecaptcha = function () {
|
|
3454
|
-
return
|
|
3455
|
+
return jt(_this2, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
3455
3456
|
var _yield$this$state, e, t, r;
|
|
3456
3457
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3457
3458
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -3482,7 +3483,7 @@ var jt = /*#__PURE__*/_createClass(function jt(e) {
|
|
|
3482
3483
|
}, _callee, this);
|
|
3483
3484
|
}));
|
|
3484
3485
|
}, this.state = e.then(function (e) {
|
|
3485
|
-
return
|
|
3486
|
+
return jt(_this2, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
3486
3487
|
var t;
|
|
3487
3488
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
3488
3489
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -3493,7 +3494,7 @@ var jt = /*#__PURE__*/_createClass(function jt(e) {
|
|
|
3493
3494
|
}
|
|
3494
3495
|
_context2.t1 = !0;
|
|
3495
3496
|
_context2.next = 4;
|
|
3496
|
-
return t = e.captchaSettings.siteKey,
|
|
3497
|
+
return t = e.captchaSettings.siteKey, Me("https://www.google.com/recaptcha/enterprise.js?render=".concat(t), function () {
|
|
3497
3498
|
return window.grecaptcha.enterprise;
|
|
3498
3499
|
});
|
|
3499
3500
|
case 4:
|
|
@@ -3536,7 +3537,7 @@ var Lt = /*#__PURE__*/function () {
|
|
|
3536
3537
|
key: "frameClient",
|
|
3537
3538
|
get: function get() {
|
|
3538
3539
|
var e;
|
|
3539
|
-
return this._frameClient = null !== (e = this._frameClient) && void 0 !== e ? e : new
|
|
3540
|
+
return this._frameClient = null !== (e = this._frameClient) && void 0 !== e ? e : new Dt(this.iframeURL), this._frameClient;
|
|
3540
3541
|
}
|
|
3541
3542
|
}, {
|
|
3542
3543
|
key: "call",
|
|
@@ -3546,13 +3547,13 @@ var Lt = /*#__PURE__*/function () {
|
|
|
3546
3547
|
}]);
|
|
3547
3548
|
return Lt;
|
|
3548
3549
|
}();
|
|
3549
|
-
var
|
|
3550
|
-
_inherits(
|
|
3551
|
-
function
|
|
3550
|
+
var Mt = /*#__PURE__*/function (_it) {
|
|
3551
|
+
_inherits(Mt, _it);
|
|
3552
|
+
function Mt(e, t, r, n, i, s) {
|
|
3552
3553
|
var _this4;
|
|
3553
|
-
_classCallCheck(this,
|
|
3554
|
-
_this4 = _callSuper(this,
|
|
3555
|
-
return
|
|
3554
|
+
_classCallCheck(this, Mt);
|
|
3555
|
+
_this4 = _callSuper(this, Mt, [e, t, r, n, i]), _this4._oneTap = s, _this4.startOneTap = function (e) {
|
|
3556
|
+
return jt(_assertThisInitialized(_this4), void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
3556
3557
|
var t, r, n;
|
|
3557
3558
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
3558
3559
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -3590,20 +3591,20 @@ var Bt = /*#__PURE__*/function (_nt) {
|
|
|
3590
3591
|
};
|
|
3591
3592
|
return _this4;
|
|
3592
3593
|
}
|
|
3593
|
-
return _createClass(
|
|
3594
|
-
}(
|
|
3595
|
-
var
|
|
3596
|
-
function
|
|
3597
|
-
_classCallCheck(this,
|
|
3594
|
+
return _createClass(Mt);
|
|
3595
|
+
}(it);
|
|
3596
|
+
var Ut = /*#__PURE__*/function () {
|
|
3597
|
+
function Ut(e, t, r, n) {
|
|
3598
|
+
_classCallCheck(this, Ut);
|
|
3598
3599
|
this._publicToken = e, this._subscriptionDataLayer = t, this.baseURL = r, this.additionalTelemetryDataFn = n, this.updateSessionToken = function () {
|
|
3599
3600
|
return null;
|
|
3600
|
-
}, this.eventLogger = new
|
|
3601
|
+
}, this.eventLogger = new Ze({
|
|
3601
3602
|
maxBatchSize: 15,
|
|
3602
3603
|
intervalDurationMs: 800,
|
|
3603
3604
|
logEventURL: this.buildSDKUrl("/events")
|
|
3604
3605
|
});
|
|
3605
3606
|
}
|
|
3606
|
-
_createClass(
|
|
3607
|
+
_createClass(Ut, [{
|
|
3607
3608
|
key: "logEvent",
|
|
3608
3609
|
value: function logEvent(_ref) {
|
|
3609
3610
|
var e = _ref.name,
|
|
@@ -3623,9 +3624,9 @@ var Mt = /*#__PURE__*/function () {
|
|
|
3623
3624
|
key: "createTelemetryBlob",
|
|
3624
3625
|
value: function createTelemetryBlob() {
|
|
3625
3626
|
return Object.assign(Object.assign({
|
|
3626
|
-
event_id: "event-id-".concat(
|
|
3627
|
-
app_session_id: "app-session-id-".concat(
|
|
3628
|
-
persistent_id: "persistent-id-".concat(
|
|
3627
|
+
event_id: "event-id-".concat(Be()),
|
|
3628
|
+
app_session_id: "app-session-id-".concat(Be()),
|
|
3629
|
+
persistent_id: "persistent-id-".concat(Be()),
|
|
3629
3630
|
client_sent_at: new Date().toISOString(),
|
|
3630
3631
|
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
3631
3632
|
}, this.additionalTelemetryDataFn()), {
|
|
@@ -3634,7 +3635,7 @@ var Mt = /*#__PURE__*/function () {
|
|
|
3634
3635
|
},
|
|
3635
3636
|
sdk: {
|
|
3636
3637
|
identifier: "Stytch.js Javascript SDK",
|
|
3637
|
-
version: "4.
|
|
3638
|
+
version: "4.6.0"
|
|
3638
3639
|
}
|
|
3639
3640
|
});
|
|
3640
3641
|
}
|
|
@@ -3645,7 +3646,7 @@ var Mt = /*#__PURE__*/function () {
|
|
|
3645
3646
|
t = _ref2.body,
|
|
3646
3647
|
r = _ref2.errorMessage,
|
|
3647
3648
|
n = _ref2.method;
|
|
3648
|
-
return
|
|
3649
|
+
return jt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
3649
3650
|
var i, s, o, a;
|
|
3650
3651
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
3651
3652
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -3675,7 +3676,7 @@ var Mt = /*#__PURE__*/function () {
|
|
|
3675
3676
|
r = _ref3.errorMessage,
|
|
3676
3677
|
n = _ref3.method,
|
|
3677
3678
|
i = _ref3.retryCallback;
|
|
3678
|
-
return
|
|
3679
|
+
return jt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
3679
3680
|
var s, o, a, c;
|
|
3680
3681
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
3681
3682
|
while (1) switch (_context5.prev = _context5.next) {
|
|
@@ -3690,9 +3691,9 @@ var Mt = /*#__PURE__*/function () {
|
|
|
3690
3691
|
o = e.xSDKParentHostHeader,
|
|
3691
3692
|
a = e.body,
|
|
3692
3693
|
c = e.retryCallback;
|
|
3693
|
-
return Ce(this, void 0, void 0,
|
|
3694
|
+
return Ce(this, void 0, void 0, he().mark(function e() {
|
|
3694
3695
|
var u;
|
|
3695
|
-
return
|
|
3696
|
+
return he().wrap(function (e) {
|
|
3696
3697
|
for (;;) switch (e.prev = e.next) {
|
|
3697
3698
|
case 0:
|
|
3698
3699
|
return u = {
|
|
@@ -3708,7 +3709,7 @@ var Mt = /*#__PURE__*/function () {
|
|
|
3708
3709
|
case 15:
|
|
3709
3710
|
return e.abrupt("return", e.sent);
|
|
3710
3711
|
case 7:
|
|
3711
|
-
if (e.prev = 7, e.t0 = e["catch"](1), !(e.t0 instanceof
|
|
3712
|
+
if (e.prev = 7, e.t0 = e["catch"](1), !(e.t0 instanceof Te)) {
|
|
3712
3713
|
e.next = 16;
|
|
3713
3714
|
break;
|
|
3714
3715
|
}
|
|
@@ -3746,14 +3747,14 @@ var Mt = /*#__PURE__*/function () {
|
|
|
3746
3747
|
return "".concat(this.baseURL, "/sdk/v1").concat(e);
|
|
3747
3748
|
}
|
|
3748
3749
|
}]);
|
|
3749
|
-
return
|
|
3750
|
+
return Ut;
|
|
3750
3751
|
}();
|
|
3751
|
-
var
|
|
3752
|
-
function
|
|
3753
|
-
_classCallCheck(this,
|
|
3752
|
+
var Nt = /*#__PURE__*/function () {
|
|
3753
|
+
function Nt(e, t, r) {
|
|
3754
|
+
_classCallCheck(this, Nt);
|
|
3754
3755
|
this._googleClient = e, this._publicToken = t, this._clientId = r;
|
|
3755
3756
|
}
|
|
3756
|
-
_createClass(
|
|
3757
|
+
_createClass(Nt, [{
|
|
3757
3758
|
key: "cancel",
|
|
3758
3759
|
value: function cancel() {
|
|
3759
3760
|
this._googleClient.cancel();
|
|
@@ -3764,7 +3765,7 @@ var Ut = /*#__PURE__*/function () {
|
|
|
3764
3765
|
var e = _ref4.callback,
|
|
3765
3766
|
t = _ref4.onOneTapCancelled,
|
|
3766
3767
|
r = _ref4.style;
|
|
3767
|
-
return
|
|
3768
|
+
return jt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
3768
3769
|
var _this5 = this;
|
|
3769
3770
|
var n;
|
|
3770
3771
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
@@ -3802,22 +3803,22 @@ var Ut = /*#__PURE__*/function () {
|
|
|
3802
3803
|
key: "styleFrame",
|
|
3803
3804
|
value: function styleFrame(e) {
|
|
3804
3805
|
e.position === exports.OneTapPositions.embedded && Array.from(document.getElementsByTagName("iframe")).forEach(function (e) {
|
|
3805
|
-
e.src.includes(
|
|
3806
|
+
e.src.includes(Se) && (e.style.width = "100%");
|
|
3806
3807
|
});
|
|
3807
3808
|
}
|
|
3808
3809
|
}]);
|
|
3809
|
-
return
|
|
3810
|
+
return Nt;
|
|
3810
3811
|
}();
|
|
3811
|
-
var
|
|
3812
|
-
function
|
|
3812
|
+
var Kt = /*#__PURE__*/function () {
|
|
3813
|
+
function Kt(e, t) {
|
|
3813
3814
|
var _this6 = this;
|
|
3814
|
-
_classCallCheck(this,
|
|
3815
|
+
_classCallCheck(this, Kt);
|
|
3815
3816
|
this._publicToken = e, this.clientsideServices = t, this.createOnSuccessHandler = function (_ref5) {
|
|
3816
3817
|
var e = _ref5.loginRedirectUrl,
|
|
3817
3818
|
t = _ref5.signupRedirectUrl,
|
|
3818
3819
|
r = _ref5.onSuccess;
|
|
3819
3820
|
return function (n) {
|
|
3820
|
-
return
|
|
3821
|
+
return jt(_this6, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
3821
3822
|
var i, _yield$this$submitGoo, s;
|
|
3822
3823
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
3823
3824
|
while (1) switch (_context7.prev = _context7.next) {
|
|
@@ -3844,10 +3845,10 @@ var Nt = /*#__PURE__*/function () {
|
|
|
3844
3845
|
window.location.href = e;
|
|
3845
3846
|
};
|
|
3846
3847
|
}
|
|
3847
|
-
_createClass(
|
|
3848
|
+
_createClass(Kt, [{
|
|
3848
3849
|
key: "createOneTapClient",
|
|
3849
3850
|
value: function createOneTapClient() {
|
|
3850
|
-
return
|
|
3851
|
+
return jt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
3851
3852
|
var e, _yield$this$fetchGoog;
|
|
3852
3853
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
3853
3854
|
while (1) switch (_context8.prev = _context8.next) {
|
|
@@ -3878,9 +3879,9 @@ var Nt = /*#__PURE__*/function () {
|
|
|
3878
3879
|
});
|
|
3879
3880
|
case 12:
|
|
3880
3881
|
_context8.t1 = !0;
|
|
3881
|
-
_context8.t2 =
|
|
3882
|
+
_context8.t2 = Nt;
|
|
3882
3883
|
_context8.next = 16;
|
|
3883
|
-
return
|
|
3884
|
+
return Me(xe, function () {
|
|
3884
3885
|
return window.google.accounts.id;
|
|
3885
3886
|
});
|
|
3886
3887
|
case 16:
|
|
@@ -3912,7 +3913,7 @@ var Nt = /*#__PURE__*/function () {
|
|
|
3912
3913
|
var e = _ref6.credential,
|
|
3913
3914
|
t = _ref6.loginRedirectUrl,
|
|
3914
3915
|
r = _ref6.signupRedirectUrl;
|
|
3915
|
-
return
|
|
3916
|
+
return jt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
3916
3917
|
var _yield$this$fetchGoog2, n;
|
|
3917
3918
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
3918
3919
|
while (1) switch (_context9.prev = _context9.next) {
|
|
@@ -3949,21 +3950,21 @@ var Nt = /*#__PURE__*/function () {
|
|
|
3949
3950
|
}, {
|
|
3950
3951
|
key: "WillGoogleOneTapShowEmbedded",
|
|
3951
3952
|
value: function WillGoogleOneTapShowEmbedded() {
|
|
3952
|
-
return !
|
|
3953
|
+
return !Kt.WillGoogleOneTapShowBannerForUA(navigator.userAgent);
|
|
3953
3954
|
}
|
|
3954
3955
|
}]);
|
|
3955
|
-
return
|
|
3956
|
+
return Kt;
|
|
3956
3957
|
}();
|
|
3957
|
-
function
|
|
3958
|
+
function qt(e) {
|
|
3958
3959
|
var t = e.toString(16);
|
|
3959
3960
|
return 1 === t.length && (t = "0" + t), t;
|
|
3960
3961
|
}
|
|
3961
|
-
var
|
|
3962
|
-
function
|
|
3963
|
-
_classCallCheck(this,
|
|
3962
|
+
var Wt = /*#__PURE__*/function () {
|
|
3963
|
+
function Wt(e, t) {
|
|
3964
|
+
_classCallCheck(this, Wt);
|
|
3964
3965
|
this._dataLayer = e, this.namespace = t;
|
|
3965
3966
|
}
|
|
3966
|
-
_createClass(
|
|
3967
|
+
_createClass(Wt, [{
|
|
3967
3968
|
key: "key",
|
|
3968
3969
|
value: function key() {
|
|
3969
3970
|
return "PKCE_VERIFIER:" + this.namespace;
|
|
@@ -3971,13 +3972,13 @@ var qt = /*#__PURE__*/function () {
|
|
|
3971
3972
|
}, {
|
|
3972
3973
|
key: "startPKCETransaction",
|
|
3973
3974
|
value: function startPKCETransaction() {
|
|
3974
|
-
return
|
|
3975
|
+
return jt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
3975
3976
|
var e;
|
|
3976
3977
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
3977
3978
|
while (1) switch (_context10.prev = _context10.next) {
|
|
3978
3979
|
case 0:
|
|
3979
3980
|
_context10.next = 2;
|
|
3980
|
-
return
|
|
3981
|
+
return Wt.createProofkeyPair();
|
|
3981
3982
|
case 2:
|
|
3982
3983
|
e = _context10.sent;
|
|
3983
3984
|
return _context10.abrupt("return", (this._dataLayer.setItem(this.key(), JSON.stringify(e)), e));
|
|
@@ -3995,7 +3996,7 @@ var qt = /*#__PURE__*/function () {
|
|
|
3995
3996
|
if (null !== e) try {
|
|
3996
3997
|
return JSON.parse(e);
|
|
3997
3998
|
} catch (e) {
|
|
3998
|
-
return void
|
|
3999
|
+
return void We("Found malformed Proof Key pair in localstorage.");
|
|
3999
4000
|
}
|
|
4000
4001
|
}
|
|
4001
4002
|
}, {
|
|
@@ -4006,7 +4007,7 @@ var qt = /*#__PURE__*/function () {
|
|
|
4006
4007
|
}], [{
|
|
4007
4008
|
key: "createProofkeyPair",
|
|
4008
4009
|
value: function createProofkeyPair() {
|
|
4009
|
-
return
|
|
4010
|
+
return jt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
4010
4011
|
var _String$fromCharCode;
|
|
4011
4012
|
var e, t, r, n;
|
|
4012
4013
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
@@ -4014,7 +4015,7 @@ var qt = /*#__PURE__*/function () {
|
|
|
4014
4015
|
case 0:
|
|
4015
4016
|
e = new Uint32Array(16);
|
|
4016
4017
|
window.crypto.getRandomValues(e);
|
|
4017
|
-
t = Array.from(e).map(
|
|
4018
|
+
t = Array.from(e).map(qt).join("");
|
|
4018
4019
|
_context11.next = 5;
|
|
4019
4020
|
return window.crypto.subtle.digest("SHA-256", new TextEncoder().encode(t));
|
|
4020
4021
|
case 5:
|
|
@@ -4031,14 +4032,14 @@ var qt = /*#__PURE__*/function () {
|
|
|
4031
4032
|
}));
|
|
4032
4033
|
}
|
|
4033
4034
|
}]);
|
|
4034
|
-
return
|
|
4035
|
+
return Wt;
|
|
4035
4036
|
}();
|
|
4036
|
-
var
|
|
4037
|
-
function
|
|
4038
|
-
_classCallCheck(this,
|
|
4037
|
+
var Gt = /*#__PURE__*/function () {
|
|
4038
|
+
function Gt(e) {
|
|
4039
|
+
_classCallCheck(this, Gt);
|
|
4039
4040
|
this._networkClient = e;
|
|
4040
4041
|
}
|
|
4041
|
-
_createClass(
|
|
4042
|
+
_createClass(Gt, [{
|
|
4042
4043
|
key: "searchUser",
|
|
4043
4044
|
value: function searchUser(e) {
|
|
4044
4045
|
return this._networkClient.fetchSDK({
|
|
@@ -4076,9 +4077,9 @@ var Wt = /*#__PURE__*/function () {
|
|
|
4076
4077
|
});
|
|
4077
4078
|
}
|
|
4078
4079
|
}]);
|
|
4079
|
-
return
|
|
4080
|
+
return Gt;
|
|
4080
4081
|
}();
|
|
4081
|
-
var
|
|
4082
|
+
var Ht = function Ht(e) {
|
|
4082
4083
|
return (document.cookie ? document.cookie.split("; ") : []).filter(function (t) {
|
|
4083
4084
|
var _t$split = t.split("="),
|
|
4084
4085
|
_t$split2 = _slicedToArray(_t$split, 1),
|
|
@@ -4087,17 +4088,17 @@ var Gt = function Gt(e) {
|
|
|
4087
4088
|
}).length > 1;
|
|
4088
4089
|
};
|
|
4089
4090
|
/*! js-cookie v3.0.1 | MIT */
|
|
4090
|
-
function
|
|
4091
|
+
function zt(e) {
|
|
4091
4092
|
for (var t = 1; t < arguments.length; t++) {
|
|
4092
4093
|
var r = arguments[t];
|
|
4093
4094
|
for (var n in r) e[n] = r[n];
|
|
4094
4095
|
}
|
|
4095
4096
|
return e;
|
|
4096
4097
|
}
|
|
4097
|
-
var
|
|
4098
|
+
var Vt = function e(t, r) {
|
|
4098
4099
|
function n(e, n, i) {
|
|
4099
4100
|
if ("undefined" != typeof document) {
|
|
4100
|
-
"number" == typeof (i =
|
|
4101
|
+
"number" == typeof (i = zt({}, r, i)).expires && (i.expires = new Date(Date.now() + 864e5 * i.expires)), i.expires && (i.expires = i.expires.toUTCString()), e = encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
4101
4102
|
var s = "";
|
|
4102
4103
|
for (var o in i) i[o] && (s += "; " + o, !0 !== i[o] && (s += "=" + i[o].split(";")[0]));
|
|
4103
4104
|
return document.cookie = e + "=" + t.write(n, e) + s;
|
|
@@ -4119,15 +4120,15 @@ var zt = function e(t, r) {
|
|
|
4119
4120
|
}
|
|
4120
4121
|
},
|
|
4121
4122
|
remove: function remove(e, t) {
|
|
4122
|
-
n(e, "",
|
|
4123
|
+
n(e, "", zt({}, t, {
|
|
4123
4124
|
expires: -1
|
|
4124
4125
|
}));
|
|
4125
4126
|
},
|
|
4126
4127
|
withAttributes: function withAttributes(t) {
|
|
4127
|
-
return e(this.converter,
|
|
4128
|
+
return e(this.converter, zt({}, this.attributes, t));
|
|
4128
4129
|
},
|
|
4129
4130
|
withConverter: function withConverter(t) {
|
|
4130
|
-
return e(
|
|
4131
|
+
return e(zt({}, this.converter, t), this.attributes);
|
|
4131
4132
|
}
|
|
4132
4133
|
}, {
|
|
4133
4134
|
attributes: {
|
|
@@ -4151,21 +4152,21 @@ var Yt = function Yt(e) {
|
|
|
4151
4152
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
4152
4153
|
return "stytch_sdk_state_".concat(e).concat(t ? "::".concat(t) : "");
|
|
4153
4154
|
},
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
clearTimeout(
|
|
4155
|
+
Jt = new Map(),
|
|
4156
|
+
$t = function $t(e) {
|
|
4157
|
+
clearTimeout(Jt.get(e));
|
|
4157
4158
|
},
|
|
4158
|
-
|
|
4159
|
-
|
|
4159
|
+
Xt = function Xt(e, t, r) {
|
|
4160
|
+
$t(e);
|
|
4160
4161
|
var n = setTimeout(function () {
|
|
4161
|
-
void 0 ===
|
|
4162
|
+
void 0 === Vt.get(e) && Vt.set(e, t, r);
|
|
4162
4163
|
}, 10);
|
|
4163
|
-
return
|
|
4164
|
+
return Jt.set(e, n), Vt.set(e, t, r);
|
|
4164
4165
|
};
|
|
4165
|
-
var
|
|
4166
|
-
function
|
|
4166
|
+
var Zt = /*#__PURE__*/function () {
|
|
4167
|
+
function Zt(e, t) {
|
|
4167
4168
|
var _this7 = this;
|
|
4168
|
-
_classCallCheck(this,
|
|
4169
|
+
_classCallCheck(this, Zt);
|
|
4169
4170
|
this.browserSessionStorage = {
|
|
4170
4171
|
getItem: function getItem(e) {
|
|
4171
4172
|
return sessionStorage.getItem(Yt(_this7.publicToken, e));
|
|
@@ -4176,7 +4177,7 @@ var Xt = /*#__PURE__*/function () {
|
|
|
4176
4177
|
removeItem: function removeItem(e) {
|
|
4177
4178
|
return sessionStorage.removeItem(Yt(_this7.publicToken, e));
|
|
4178
4179
|
}
|
|
4179
|
-
}, this.publicToken = e, this.state = null, this.stateKeysUpdated = new Set(), this.subscriptions = {}, (null == t ? void 0 : t.cookieOptions) ? (
|
|
4180
|
+
}, this.publicToken = e, this.state = null, this.stateKeysUpdated = new Set(), this.subscriptions = {}, (null == t ? void 0 : t.cookieOptions) ? (ze("SubscriptionDataLayer").isOptionalString("cookieOptions.opaqueTokenCookieName", t.cookieOptions.opaqueTokenCookieName).isOptionalString("cookieOptions.jwtCookieName", t.cookieOptions.jwtCookieName).isOptionalString("cookieOptions.istCookieName", t.cookieOptions.istCookieName).isOptionalString("cookieOptions.path", t.cookieOptions.path).isOptionalString("cookieOptions.domain", t.cookieOptions.domain), this._jwtCookieName = t.cookieOptions.jwtCookieName || null, this._opaqueTokenCookieName = t.cookieOptions.opaqueTokenCookieName || null, this._cookiePath = t.cookieOptions.path || null, this._domain = t.cookieOptions.domain || null, this._cookieAvailableToSubdomains = t.cookieOptions.availableToSubdomains || !1, this._istCookieName = t.cookieOptions.istCookieName || null) : (this._opaqueTokenCookieName = null, this._jwtCookieName = null, this._cookiePath = null, this._domain = null, this._cookieAvailableToSubdomains = !1, this._istCookieName = null);
|
|
4180
4181
|
var r = localStorage.getItem(Yt(this.publicToken));
|
|
4181
4182
|
if (!r) return;
|
|
4182
4183
|
var n;
|
|
@@ -4187,7 +4188,7 @@ var Xt = /*#__PURE__*/function () {
|
|
|
4187
4188
|
}
|
|
4188
4189
|
this.state = n;
|
|
4189
4190
|
}
|
|
4190
|
-
_createClass(
|
|
4191
|
+
_createClass(Zt, [{
|
|
4191
4192
|
key: "opaqueTokenCookieName",
|
|
4192
4193
|
get: function get() {
|
|
4193
4194
|
var e;
|
|
@@ -4209,14 +4210,14 @@ var Xt = /*#__PURE__*/function () {
|
|
|
4209
4210
|
key: "readSessionCookie",
|
|
4210
4211
|
value: function readSessionCookie() {
|
|
4211
4212
|
return {
|
|
4212
|
-
session_token:
|
|
4213
|
-
session_jwt:
|
|
4213
|
+
session_token: Vt.get(this.opaqueTokenCookieName),
|
|
4214
|
+
session_jwt: Vt.get(this.jwtCookieName)
|
|
4214
4215
|
};
|
|
4215
4216
|
}
|
|
4216
4217
|
}, {
|
|
4217
4218
|
key: "readIntermediateSessionTokenCookie",
|
|
4218
4219
|
value: function readIntermediateSessionTokenCookie() {
|
|
4219
|
-
return
|
|
4220
|
+
return Vt.get(this.istCookieName);
|
|
4220
4221
|
}
|
|
4221
4222
|
}, {
|
|
4222
4223
|
key: "writeSessionCookie",
|
|
@@ -4225,32 +4226,32 @@ var Xt = /*#__PURE__*/function () {
|
|
|
4225
4226
|
var s = e.state,
|
|
4226
4227
|
o = e.session_token,
|
|
4227
4228
|
a = e.session_jwt,
|
|
4228
|
-
c =
|
|
4229
|
+
c = Zt.generateCookieOpts({
|
|
4229
4230
|
expiresAt: null !== (r = null === (t = null == s ? void 0 : s.session) || void 0 === t ? void 0 : t.expires_at) && void 0 !== r ? r : "",
|
|
4230
4231
|
availableToSubdomains: this._cookieAvailableToSubdomains,
|
|
4231
4232
|
path: this._cookiePath,
|
|
4232
4233
|
domain: this._domain
|
|
4233
4234
|
});
|
|
4234
|
-
|
|
4235
|
-
var u =
|
|
4235
|
+
Xt(this.opaqueTokenCookieName, o, c), Xt(this.jwtCookieName, a, c);
|
|
4236
|
+
var u = Zt.generateCookieOpts({
|
|
4236
4237
|
expiresAt: null !== (i = null === (n = null == s ? void 0 : s.session) || void 0 === n ? void 0 : n.expires_at) && void 0 !== i ? i : "",
|
|
4237
4238
|
availableToSubdomains: !this._cookieAvailableToSubdomains,
|
|
4238
4239
|
path: this._cookiePath,
|
|
4239
4240
|
domain: this._domain
|
|
4240
4241
|
});
|
|
4241
|
-
|
|
4242
|
+
Ht(this.jwtCookieName) && Vt.remove(this.jwtCookieName, u), Ht(this.opaqueTokenCookieName) && Vt.remove(this.opaqueTokenCookieName, u), Ht(this.jwtCookieName) && We("Could not remove extraneous JWT cookie. This might happen if the cookie has been set using multiple `path` settings, and may produce unwanted behavior."), Ht(this.opaqueTokenCookieName) && We("Could not remove extraneous opaque token cookie.");
|
|
4242
4243
|
}
|
|
4243
4244
|
}, {
|
|
4244
4245
|
key: "writeIntermediateSessionTokenCookie",
|
|
4245
4246
|
value: function writeIntermediateSessionTokenCookie(e) {
|
|
4246
4247
|
var t = new Date(Date.now() + 6e5),
|
|
4247
|
-
r =
|
|
4248
|
+
r = Zt.generateCookieOpts({
|
|
4248
4249
|
expiresAt: t.toString(),
|
|
4249
4250
|
availableToSubdomains: this._cookieAvailableToSubdomains,
|
|
4250
4251
|
path: this._cookiePath,
|
|
4251
4252
|
domain: this._domain
|
|
4252
4253
|
});
|
|
4253
|
-
|
|
4254
|
+
Xt(this.istCookieName, e, r);
|
|
4254
4255
|
}
|
|
4255
4256
|
}, {
|
|
4256
4257
|
key: "removeSessionCookie",
|
|
@@ -4269,18 +4270,18 @@ var Xt = /*#__PURE__*/function () {
|
|
|
4269
4270
|
[!0, !1].forEach(function (t) {
|
|
4270
4271
|
[_this8._cookiePath, null].forEach(function (r) {
|
|
4271
4272
|
[_this8._domain, null].forEach(function (n) {
|
|
4272
|
-
var i =
|
|
4273
|
+
var i = Zt.generateCookieOpts({
|
|
4273
4274
|
expiresAt: new Date(0).toString(),
|
|
4274
4275
|
availableToSubdomains: t,
|
|
4275
4276
|
path: r,
|
|
4276
4277
|
domain: n
|
|
4277
4278
|
});
|
|
4278
4279
|
e.forEach(function (e) {
|
|
4279
|
-
|
|
4280
|
+
Vt.remove(e, i);
|
|
4280
4281
|
});
|
|
4281
4282
|
});
|
|
4282
4283
|
});
|
|
4283
|
-
}), e.forEach(
|
|
4284
|
+
}), e.forEach($t);
|
|
4284
4285
|
}
|
|
4285
4286
|
}, {
|
|
4286
4287
|
key: "syncToLocalStorage",
|
|
@@ -4325,40 +4326,40 @@ var Xt = /*#__PURE__*/function () {
|
|
|
4325
4326
|
return e && (i.path = e), Boolean("localhost" === window.location.hostname || "[::1]" === window.location.hostname || window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)) ? i.secure = !1 : (r && (i.domain = t || window.location.host), i.secure = !0), i;
|
|
4326
4327
|
}
|
|
4327
4328
|
}]);
|
|
4328
|
-
return
|
|
4329
|
+
return Zt;
|
|
4329
4330
|
}();
|
|
4330
|
-
var
|
|
4331
|
-
_inherits(
|
|
4332
|
-
function
|
|
4333
|
-
_classCallCheck(this,
|
|
4334
|
-
return _callSuper(this,
|
|
4331
|
+
var Qt = /*#__PURE__*/function (_Zt) {
|
|
4332
|
+
_inherits(Qt, _Zt);
|
|
4333
|
+
function Qt() {
|
|
4334
|
+
_classCallCheck(this, Qt);
|
|
4335
|
+
return _callSuper(this, Qt, arguments);
|
|
4335
4336
|
}
|
|
4336
|
-
return _createClass(
|
|
4337
|
-
}(
|
|
4338
|
-
var
|
|
4339
|
-
|
|
4337
|
+
return _createClass(Qt);
|
|
4338
|
+
}(Zt);
|
|
4339
|
+
var er = Symbol["for"]("__stytch_DataLayer"),
|
|
4340
|
+
tr = function tr(e, t) {
|
|
4340
4341
|
var r = function () {
|
|
4341
4342
|
var e = window;
|
|
4342
|
-
return e[
|
|
4343
|
+
return e[er] || (e[er] = {}), e[er];
|
|
4343
4344
|
}();
|
|
4344
|
-
return r[e] || (r[e] = new
|
|
4345
|
+
return r[e] || (r[e] = new Qt(e, t)), r[e];
|
|
4345
4346
|
},
|
|
4346
|
-
|
|
4347
|
+
rr = function rr(e, t) {
|
|
4347
4348
|
Object.values(e).forEach(function (e) {
|
|
4348
4349
|
return e(t);
|
|
4349
4350
|
});
|
|
4350
4351
|
},
|
|
4351
|
-
|
|
4352
|
+
nr = function () {
|
|
4352
4353
|
var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).KEYS_TO_EXCLUDE,
|
|
4353
4354
|
t = void 0 === e ? [] : e;
|
|
4354
4355
|
return function e(r, n) {
|
|
4355
|
-
return
|
|
4356
|
+
return de(r) === de(n) && (null === r || null === n ? r === n : "object" === de(r) ? Object.keys(r).length === Object.keys(n).length && !Object.keys(r).some(function (e) {
|
|
4356
4357
|
return !(e in n);
|
|
4357
4358
|
}) && Object.entries(r).filter(function (e) {
|
|
4358
|
-
var r =
|
|
4359
|
+
var r = ce(e, 1)[0];
|
|
4359
4360
|
return !t.includes(r);
|
|
4360
4361
|
}).every(function (t) {
|
|
4361
|
-
var r =
|
|
4362
|
+
var r = ce(t, 2),
|
|
4362
4363
|
i = r[0],
|
|
4363
4364
|
s = r[1];
|
|
4364
4365
|
return e(s, n[i]);
|
|
@@ -4367,10 +4368,10 @@ var Qt = Symbol["for"]("__stytch_DataLayer"),
|
|
|
4367
4368
|
}({
|
|
4368
4369
|
KEYS_TO_EXCLUDE: ["last_accessed_at"]
|
|
4369
4370
|
});
|
|
4370
|
-
var
|
|
4371
|
-
function
|
|
4371
|
+
var ir = /*#__PURE__*/function () {
|
|
4372
|
+
function ir(e, t) {
|
|
4372
4373
|
var _this10 = this;
|
|
4373
|
-
_classCallCheck(this,
|
|
4374
|
+
_classCallCheck(this, ir);
|
|
4374
4375
|
this._publicToken = e, this._datalayer = t, this._listen = function (e) {
|
|
4375
4376
|
if (e.key !== Yt(_this10._publicToken)) return;
|
|
4376
4377
|
var t = null === e.newValue || "null" === e.newValue ? null : JSON.parse(e.newValue);
|
|
@@ -4380,7 +4381,7 @@ var nr = /*#__PURE__*/function () {
|
|
|
4380
4381
|
r = _this$_datalayer$read.session_token;
|
|
4381
4382
|
r || this.destroySession();
|
|
4382
4383
|
}
|
|
4383
|
-
_createClass(
|
|
4384
|
+
_createClass(ir, [{
|
|
4384
4385
|
key: "getTokens",
|
|
4385
4386
|
value: function getTokens() {
|
|
4386
4387
|
var _this$_datalayer$read2 = this._datalayer.readSessionCookie(),
|
|
@@ -4418,7 +4419,7 @@ var nr = /*#__PURE__*/function () {
|
|
|
4418
4419
|
r = null === e.state ? null : Object.assign(Object.assign({}, this._datalayer.state), e.state);
|
|
4419
4420
|
this._datalayer.state = r;
|
|
4420
4421
|
var n = e.state ? Object.keys(e.state) : [];
|
|
4421
|
-
!this._datalayer.markStateKeysUpdated(n) &&
|
|
4422
|
+
!this._datalayer.markStateKeysUpdated(n) && nr(t, r) || rr(this._datalayer.subscriptions, r);
|
|
4422
4423
|
}
|
|
4423
4424
|
}, {
|
|
4424
4425
|
key: "updateStateAndTokens",
|
|
@@ -4433,8 +4434,8 @@ var nr = /*#__PURE__*/function () {
|
|
|
4433
4434
|
this._datalayer.state = r;
|
|
4434
4435
|
var n = e ? Object.keys(e) : [],
|
|
4435
4436
|
i = this._datalayer.markStateKeysUpdated(n),
|
|
4436
|
-
s = !
|
|
4437
|
-
(i || s) && (
|
|
4437
|
+
s = !nr(t, r);
|
|
4438
|
+
(i || s) && (rr(this._datalayer.subscriptions, r), s && this._datalayer.syncToLocalStorage());
|
|
4438
4439
|
}
|
|
4439
4440
|
}, {
|
|
4440
4441
|
key: "updateTokens",
|
|
@@ -4474,14 +4475,14 @@ var nr = /*#__PURE__*/function () {
|
|
|
4474
4475
|
return null;
|
|
4475
4476
|
}
|
|
4476
4477
|
}]);
|
|
4477
|
-
return
|
|
4478
|
+
return ir;
|
|
4478
4479
|
}();
|
|
4479
|
-
var
|
|
4480
|
-
_inherits(
|
|
4481
|
-
function
|
|
4480
|
+
var sr = /*#__PURE__*/function (_ir) {
|
|
4481
|
+
_inherits(sr, _ir);
|
|
4482
|
+
function sr() {
|
|
4482
4483
|
var _this11;
|
|
4483
|
-
_classCallCheck(this,
|
|
4484
|
-
_this11 = _callSuper(this,
|
|
4484
|
+
_classCallCheck(this, sr);
|
|
4485
|
+
_this11 = _callSuper(this, sr, arguments), _this11.updateUser = function (e) {
|
|
4485
4486
|
return _this11.updateState({
|
|
4486
4487
|
user: e
|
|
4487
4488
|
});
|
|
@@ -4494,10 +4495,10 @@ var ir = /*#__PURE__*/function (_nr) {
|
|
|
4494
4495
|
};
|
|
4495
4496
|
return _this11;
|
|
4496
4497
|
}
|
|
4497
|
-
return _createClass(
|
|
4498
|
-
}(
|
|
4499
|
-
var
|
|
4500
|
-
exports.BiometricsFailedError =
|
|
4498
|
+
return _createClass(sr);
|
|
4499
|
+
}(ir);
|
|
4500
|
+
var or = Symbol["for"]("stytch__internal_b2c");
|
|
4501
|
+
exports.BiometricsFailedError = Z, exports.BiometricsUnavailableError = j, exports.ChallengeSigningFailedError = V, exports.DeviceCredentialsNotAllowedError = K, exports.FailedCodeChallengeError = J, exports.FailedToDecryptDataError = X, exports.InternalError = I, exports.InvalidAuthorizationCredentialError = H, exports.InvalidCredentialTypeError = re, exports.InvalidRedirectSchemeError = ee, exports.InvalidStartUrlError = Q, exports.JSONDataNotConvertibleToStringError = ie, exports.KeyInvalidatedError = B, exports.KeystoreUnavailableError = L, exports.MissingAttestationObjectError = ne, exports.MissingAuthorizationCredentialIDTokenError = G, exports.MissingGoogleClientIDError = q, exports.MissingPKCEError = W, exports.MissingPublicKeyError = z, exports.MissingUrlError = te, exports.NoBiometricsEnrolledError = M, exports.NoBiometricsRegistrationError = F, exports.NoCurrentSessionError = R, exports.PasskeysInvalidEncoding = oe, exports.PasskeysUnsupportedError = $, exports.RandomNumberGenerationFailed = se, exports.SDKAPIUnreachableError = w, exports.SDKNotConfiguredError = Y, exports.StytchAPIError = E, exports.StytchAPISchemaError = A, exports.StytchAPIUnreachableError = T, exports.StytchError = O, exports.StytchHeadlessClient = /*#__PURE__*/function () {
|
|
4501
4502
|
function _class(e, t) {
|
|
4502
4503
|
var _this12 = this;
|
|
4503
4504
|
_classCallCheck(this, _class);
|
|
@@ -4505,7 +4506,7 @@ exports.BiometricsFailedError = X, exports.BiometricsUnavailableError = F, expor
|
|
|
4505
4506
|
!function (e) {
|
|
4506
4507
|
var t = "StytchUIClient" === e ? "import { createStytchUIClient } from '@stytch/nextjs/ui';\n \nconst stytch = createStytchUIClient('public-token-...');\n" : "import { createStytchHeadlessClient } from '@stytch/nextjs/ui';\n \nconst stytch = createStytchHeadlessClient('public-token-...');\n";
|
|
4507
4508
|
if ("undefined" == typeof window) throw new Error("The ".concat(e, " is not compatible with server-side environments.\nIf using nextjs, use the create").concat(e, " method instead.\n```\n").concat(t, "\n```\n"));
|
|
4508
|
-
}("StytchHeadlessClient"), "string" != typeof (r = e) ?
|
|
4509
|
+
}("StytchHeadlessClient"), "string" != typeof (r = e) ? We("Public token is malformed. Expected a string, got ".concat(de(r), ".").concat(He)) : "" === r ? We('Public token is malformed. Expected "public-token-...", got an empty string.'.concat(He)) : r.startsWith("public-token-") || We('Public token is malformed. Expected "public-token-...", got '.concat(r, ".").concat(He));
|
|
4509
4510
|
var n = t,
|
|
4510
4511
|
i = {
|
|
4511
4512
|
cookieOptions: null == (s = n) ? void 0 : s.cookieOptions,
|
|
@@ -4518,27 +4519,27 @@ exports.BiometricsFailedError = X, exports.BiometricsUnavailableError = F, expor
|
|
|
4518
4519
|
}
|
|
4519
4520
|
};
|
|
4520
4521
|
var s, o, a, c, u, l, d, h, p, f, _;
|
|
4521
|
-
this._dataLayer =
|
|
4522
|
-
var m = new
|
|
4523
|
-
this._networkClient = new
|
|
4522
|
+
this._dataLayer = tr(e, n), this._subscriptionService = new sr(e, this._dataLayer);
|
|
4523
|
+
var m = new Wt(this._dataLayer, "passwords");
|
|
4524
|
+
this._networkClient = new Ut(e, this._dataLayer, i.endpoints.sdkBackendURL, function () {
|
|
4524
4525
|
var e, t, r, n;
|
|
4525
4526
|
return {
|
|
4526
4527
|
stytch_user_id: null === (t = null === (e = _this12._dataLayer.state) || void 0 === e ? void 0 : e.user) || void 0 === t ? void 0 : t.user_id,
|
|
4527
4528
|
stytch_session_id: null === (n = null === (r = _this12._dataLayer.state) || void 0 === r ? void 0 : r.session) || void 0 === n ? void 0 : n.session_id
|
|
4528
4529
|
};
|
|
4529
4530
|
});
|
|
4530
|
-
var v = new
|
|
4531
|
-
y = new
|
|
4532
|
-
g = new
|
|
4531
|
+
var v = new Ft(e, this._networkClient, this._dataLayer),
|
|
4532
|
+
y = new Bt(v.getAsync()),
|
|
4533
|
+
g = new Je(e, i.endpoints.dfpBackendURL, v.getAsync(), y.executeRecaptcha),
|
|
4533
4534
|
b = new Lt(i.endpoints.clientsideServicesIframeURL),
|
|
4534
|
-
k = new
|
|
4535
|
-
w = new
|
|
4535
|
+
k = new Kt(e, b),
|
|
4536
|
+
w = new Gt(this._networkClient);
|
|
4536
4537
|
var S, x;
|
|
4537
|
-
this.user = new
|
|
4538
|
+
this.user = new Qe(this._networkClient, this._subscriptionService), this.session = new et(this._networkClient, this._subscriptionService), this.magicLinks = new rt(this._networkClient, this._subscriptionService, new Wt(this._dataLayer, "magic_links"), m, v.getAsync(), g), this.otps = new nt(this._networkClient, this._subscriptionService, y.executeRecaptcha, g), this.oauth = new Mt(this._networkClient, this._subscriptionService, new Wt(this._dataLayer, "oauth"), v.getAsync(), {
|
|
4538
4539
|
publicToken: e,
|
|
4539
4540
|
testAPIURL: i.endpoints.testAPIURL,
|
|
4540
4541
|
liveAPIURL: i.endpoints.liveAPIURL
|
|
4541
|
-
}, k), this.cryptoWallets = new
|
|
4542
|
+
}, k), this.cryptoWallets = new st(this._networkClient, this._subscriptionService, y.executeRecaptcha, g), this.totps = new ot(this._networkClient, this._subscriptionService, g), this.webauthn = new Tt(this._networkClient, this._subscriptionService, g), this.passwords = new Et(this._networkClient, this._subscriptionService, m, v.getAsync(), g), this._sessionManager = new Rt(this._subscriptionService, this.session), this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
|
|
4542
4543
|
name: "sdk_instance_instantiated",
|
|
4543
4544
|
details: {
|
|
4544
4545
|
event_callback_registered: !1,
|
|
@@ -4554,73 +4555,73 @@ exports.BiometricsFailedError = X, exports.BiometricsUnavailableError = F, expor
|
|
|
4554
4555
|
publicToken: e,
|
|
4555
4556
|
dataLayer: this._dataLayer,
|
|
4556
4557
|
networkClient: this._networkClient
|
|
4557
|
-
}, Object.assign(S, _defineProperty({},
|
|
4558
|
+
}, Object.assign(S, _defineProperty({}, or, x));
|
|
4558
4559
|
}
|
|
4559
4560
|
return _createClass(_class);
|
|
4560
|
-
}(), exports.StytchSDKAPIError =
|
|
4561
|
+
}(), exports.StytchSDKAPIError = P, exports.StytchSDKError = D, exports.StytchSDKSchemaError = x, exports.StytchSDKUsageError = S, exports.UNRECOVERABLE_ERROR_TYPES = C, exports.UserCancellationError = U, exports.UserLockedOutError = N, exports.errorToStytchError = function (e) {
|
|
4561
4562
|
switch (e.message) {
|
|
4562
4563
|
case "internal_error":
|
|
4563
|
-
return new
|
|
4564
|
+
return new I(e.message);
|
|
4564
4565
|
case "no_current_session":
|
|
4565
|
-
return new
|
|
4566
|
+
return new R();
|
|
4566
4567
|
case "no_biometrics_registration":
|
|
4567
|
-
return new
|
|
4568
|
+
return new F();
|
|
4568
4569
|
case "biometrics_unavailable":
|
|
4569
4570
|
case "device_hardware_error":
|
|
4570
4571
|
case "biometrics_not_available":
|
|
4571
|
-
return new
|
|
4572
|
+
return new j();
|
|
4572
4573
|
case "key_invalidated":
|
|
4573
4574
|
case "no_biometric_key":
|
|
4574
|
-
return new j();
|
|
4575
|
-
case "no_biometrics_enrolled":
|
|
4576
4575
|
return new B();
|
|
4576
|
+
case "no_biometrics_enrolled":
|
|
4577
|
+
return new M();
|
|
4577
4578
|
case "keystore_unavailable":
|
|
4578
4579
|
return new L();
|
|
4579
4580
|
case "device_credentials_not_allowed":
|
|
4580
|
-
return new
|
|
4581
|
+
return new K();
|
|
4581
4582
|
case "user_cancellation":
|
|
4582
|
-
return new M();
|
|
4583
|
-
case "user_locked_out":
|
|
4584
4583
|
return new U();
|
|
4584
|
+
case "user_locked_out":
|
|
4585
|
+
return new N();
|
|
4585
4586
|
case "google_onetap_missing_id_token":
|
|
4586
4587
|
case "oauth_apple_missing_id_token":
|
|
4587
4588
|
case "missing_authorization_credential_id_token":
|
|
4588
|
-
return new
|
|
4589
|
+
return new G();
|
|
4589
4590
|
case "google_onetap_missing_member":
|
|
4590
4591
|
case "oauth_apple_credential_invalid":
|
|
4591
4592
|
case "invalid_authorization_credential":
|
|
4592
|
-
return new G();
|
|
4593
|
-
case "missing_public_key":
|
|
4594
4593
|
return new H();
|
|
4595
|
-
case "
|
|
4594
|
+
case "missing_public_key":
|
|
4596
4595
|
return new z();
|
|
4596
|
+
case "challenge_signing_failed":
|
|
4597
|
+
return new V();
|
|
4597
4598
|
case "sdk_not_configured":
|
|
4598
4599
|
return new Y();
|
|
4599
4600
|
case "failed_code_challenge":
|
|
4600
|
-
return new V();
|
|
4601
|
-
case "passkeys_unsupported":
|
|
4602
4601
|
return new J();
|
|
4603
|
-
case "
|
|
4602
|
+
case "passkeys_unsupported":
|
|
4604
4603
|
return new $();
|
|
4605
|
-
case "
|
|
4604
|
+
case "failed_to_decrypt_data":
|
|
4606
4605
|
return new X();
|
|
4607
|
-
case "
|
|
4606
|
+
case "biometrics_failed":
|
|
4608
4607
|
return new Z();
|
|
4609
|
-
case "
|
|
4608
|
+
case "invalid_start_url":
|
|
4610
4609
|
return new Q();
|
|
4611
|
-
case "
|
|
4610
|
+
case "invalid_redirect_scheme":
|
|
4612
4611
|
return new ee();
|
|
4613
|
-
case "
|
|
4612
|
+
case "missing_url":
|
|
4614
4613
|
return new te();
|
|
4615
|
-
case "
|
|
4614
|
+
case "invalid_credential_type":
|
|
4616
4615
|
return new re();
|
|
4617
|
-
case "
|
|
4616
|
+
case "missing_attestation_object":
|
|
4618
4617
|
return new ne();
|
|
4619
|
-
case "
|
|
4618
|
+
case "json_data_not_convertible_to_string":
|
|
4620
4619
|
return new ie();
|
|
4621
|
-
case "
|
|
4620
|
+
case "random_number_generation_failed":
|
|
4622
4621
|
return new se();
|
|
4622
|
+
case "passkeys_invalid_encoding":
|
|
4623
|
+
return new oe();
|
|
4623
4624
|
default:
|
|
4624
|
-
return new
|
|
4625
|
+
return new D(e.name, e.message);
|
|
4625
4626
|
}
|
|
4626
4627
|
};
|