@descope/web-js-sdk 1.8.5 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.d.ts +104 -8
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -92,10 +92,11 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
92
92
|
samlIdpStateId?: string;
|
|
93
93
|
samlIdpUsername?: string;
|
|
94
94
|
ssoAppId?: string;
|
|
95
|
+
oidcLoginHint?: string;
|
|
95
96
|
abTestingKey?: number;
|
|
96
97
|
startOptionsVersion?: number;
|
|
97
98
|
client?: Record<string, any>;
|
|
98
|
-
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "preview" | "abTestingKey" | "client"> & {
|
|
99
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client"> & {
|
|
99
100
|
lastAuth?: Omit<{
|
|
100
101
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
101
102
|
oauthProvider?: string;
|
|
@@ -215,6 +216,9 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
215
216
|
email: <T extends boolean>(loginId: string, email: string, token?: string, updateOptions?: {
|
|
216
217
|
addToLoginIDs?: T;
|
|
217
218
|
onMergeUseExisting?: T extends true ? boolean : never;
|
|
219
|
+
templateOptions?: {
|
|
220
|
+
[x: string]: string;
|
|
221
|
+
};
|
|
218
222
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
219
223
|
maskedEmail: string;
|
|
220
224
|
}>>;
|
|
@@ -222,12 +226,18 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
222
226
|
sms: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
|
|
223
227
|
addToLoginIDs?: T_1;
|
|
224
228
|
onMergeUseExisting?: T_1 extends true ? boolean : never;
|
|
229
|
+
templateOptions?: {
|
|
230
|
+
[x: string]: string;
|
|
231
|
+
};
|
|
225
232
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
226
233
|
maskedPhone: string;
|
|
227
234
|
}>>;
|
|
228
235
|
whatsapp: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
|
|
229
236
|
addToLoginIDs?: T_1;
|
|
230
237
|
onMergeUseExisting?: T_1 extends true ? boolean : never;
|
|
238
|
+
templateOptions?: {
|
|
239
|
+
[x: string]: string;
|
|
240
|
+
};
|
|
231
241
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
232
242
|
maskedPhone: string;
|
|
233
243
|
}>>;
|
|
@@ -294,6 +304,9 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
294
304
|
email: <T_2 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
|
|
295
305
|
addToLoginIDs?: T_2;
|
|
296
306
|
onMergeUseExisting?: T_2 extends true ? boolean : never;
|
|
307
|
+
templateOptions?: {
|
|
308
|
+
[x: string]: string;
|
|
309
|
+
};
|
|
297
310
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
298
311
|
maskedEmail: string;
|
|
299
312
|
}>>;
|
|
@@ -301,12 +314,18 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
301
314
|
sms: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
|
|
302
315
|
addToLoginIDs?: T_3;
|
|
303
316
|
onMergeUseExisting?: T_3 extends true ? boolean : never;
|
|
317
|
+
templateOptions?: {
|
|
318
|
+
[x: string]: string;
|
|
319
|
+
};
|
|
304
320
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
305
321
|
maskedPhone: string;
|
|
306
322
|
}>>;
|
|
307
323
|
whatsapp: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
|
|
308
324
|
addToLoginIDs?: T_3;
|
|
309
325
|
onMergeUseExisting?: T_3 extends true ? boolean : never;
|
|
326
|
+
templateOptions?: {
|
|
327
|
+
[x: string]: string;
|
|
328
|
+
};
|
|
310
329
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
311
330
|
maskedPhone: string;
|
|
312
331
|
}>>;
|
|
@@ -333,6 +352,9 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
333
352
|
email: <T_4 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
|
|
334
353
|
addToLoginIDs?: T_4;
|
|
335
354
|
onMergeUseExisting?: T_4 extends true ? boolean : never;
|
|
355
|
+
templateOptions?: {
|
|
356
|
+
[x: string]: string;
|
|
357
|
+
};
|
|
336
358
|
}) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
|
|
337
359
|
};
|
|
338
360
|
};
|
|
@@ -376,7 +398,9 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
376
398
|
phone?: string;
|
|
377
399
|
}) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
378
400
|
signIn: (loginId: string, password: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
379
|
-
sendReset: (loginId: string, redirectUrl?: string
|
|
401
|
+
sendReset: (loginId: string, redirectUrl?: string, templateOptions?: {
|
|
402
|
+
[x: string]: string;
|
|
403
|
+
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
380
404
|
resetMethod: string;
|
|
381
405
|
pendingRef?: string;
|
|
382
406
|
linkId?: string;
|
|
@@ -459,10 +483,11 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
459
483
|
samlIdpStateId?: string;
|
|
460
484
|
samlIdpUsername?: string;
|
|
461
485
|
ssoAppId?: string;
|
|
486
|
+
oidcLoginHint?: string;
|
|
462
487
|
abTestingKey?: number;
|
|
463
488
|
startOptionsVersion?: number;
|
|
464
489
|
client?: Record<string, any>;
|
|
465
|
-
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "preview" | "abTestingKey" | "client"> & {
|
|
490
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client"> & {
|
|
466
491
|
lastAuth?: Omit<{
|
|
467
492
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
468
493
|
oauthProvider?: string;
|
|
@@ -582,6 +607,9 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
582
607
|
email: <T extends boolean>(loginId: string, email: string, token?: string, updateOptions?: {
|
|
583
608
|
addToLoginIDs?: T;
|
|
584
609
|
onMergeUseExisting?: T extends true ? boolean : never;
|
|
610
|
+
templateOptions?: {
|
|
611
|
+
[x: string]: string;
|
|
612
|
+
};
|
|
585
613
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
586
614
|
maskedEmail: string;
|
|
587
615
|
}>>;
|
|
@@ -589,12 +617,18 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
589
617
|
sms: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
|
|
590
618
|
addToLoginIDs?: T_1;
|
|
591
619
|
onMergeUseExisting?: T_1 extends true ? boolean : never;
|
|
620
|
+
templateOptions?: {
|
|
621
|
+
[x: string]: string;
|
|
622
|
+
};
|
|
592
623
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
593
624
|
maskedPhone: string;
|
|
594
625
|
}>>;
|
|
595
626
|
whatsapp: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
|
|
596
627
|
addToLoginIDs?: T_1;
|
|
597
628
|
onMergeUseExisting?: T_1 extends true ? boolean : never;
|
|
629
|
+
templateOptions?: {
|
|
630
|
+
[x: string]: string;
|
|
631
|
+
};
|
|
598
632
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
599
633
|
maskedPhone: string;
|
|
600
634
|
}>>;
|
|
@@ -661,6 +695,9 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
661
695
|
email: <T_2 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
|
|
662
696
|
addToLoginIDs?: T_2;
|
|
663
697
|
onMergeUseExisting?: T_2 extends true ? boolean : never;
|
|
698
|
+
templateOptions?: {
|
|
699
|
+
[x: string]: string;
|
|
700
|
+
};
|
|
664
701
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
665
702
|
maskedEmail: string;
|
|
666
703
|
}>>;
|
|
@@ -668,12 +705,18 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
668
705
|
sms: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
|
|
669
706
|
addToLoginIDs?: T_3;
|
|
670
707
|
onMergeUseExisting?: T_3 extends true ? boolean : never;
|
|
708
|
+
templateOptions?: {
|
|
709
|
+
[x: string]: string;
|
|
710
|
+
};
|
|
671
711
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
672
712
|
maskedPhone: string;
|
|
673
713
|
}>>;
|
|
674
714
|
whatsapp: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
|
|
675
715
|
addToLoginIDs?: T_3;
|
|
676
716
|
onMergeUseExisting?: T_3 extends true ? boolean : never;
|
|
717
|
+
templateOptions?: {
|
|
718
|
+
[x: string]: string;
|
|
719
|
+
};
|
|
677
720
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
678
721
|
maskedPhone: string;
|
|
679
722
|
}>>;
|
|
@@ -700,6 +743,9 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
700
743
|
email: <T_4 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
|
|
701
744
|
addToLoginIDs?: T_4;
|
|
702
745
|
onMergeUseExisting?: T_4 extends true ? boolean : never;
|
|
746
|
+
templateOptions?: {
|
|
747
|
+
[x: string]: string;
|
|
748
|
+
};
|
|
703
749
|
}) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
|
|
704
750
|
};
|
|
705
751
|
};
|
|
@@ -743,7 +789,9 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
743
789
|
phone?: string;
|
|
744
790
|
}) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
745
791
|
signIn: (loginId: string, password: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
746
|
-
sendReset: (loginId: string, redirectUrl?: string
|
|
792
|
+
sendReset: (loginId: string, redirectUrl?: string, templateOptions?: {
|
|
793
|
+
[x: string]: string;
|
|
794
|
+
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
747
795
|
resetMethod: string;
|
|
748
796
|
pendingRef?: string;
|
|
749
797
|
linkId?: string;
|
|
@@ -835,10 +883,11 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
835
883
|
samlIdpStateId?: string;
|
|
836
884
|
samlIdpUsername?: string;
|
|
837
885
|
ssoAppId?: string;
|
|
886
|
+
oidcLoginHint?: string;
|
|
838
887
|
abTestingKey?: number;
|
|
839
888
|
startOptionsVersion?: number;
|
|
840
889
|
client?: Record<string, any>;
|
|
841
|
-
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "preview" | "abTestingKey" | "client"> & {
|
|
890
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client"> & {
|
|
842
891
|
lastAuth?: Omit<{
|
|
843
892
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
844
893
|
oauthProvider?: string;
|
|
@@ -958,6 +1007,9 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
958
1007
|
email: <T extends boolean>(loginId: string, email: string, token?: string, updateOptions?: {
|
|
959
1008
|
addToLoginIDs?: T;
|
|
960
1009
|
onMergeUseExisting?: T extends true ? boolean : never;
|
|
1010
|
+
templateOptions?: {
|
|
1011
|
+
[x: string]: string;
|
|
1012
|
+
};
|
|
961
1013
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
962
1014
|
maskedEmail: string;
|
|
963
1015
|
}>>;
|
|
@@ -965,12 +1017,18 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
965
1017
|
sms: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
|
|
966
1018
|
addToLoginIDs?: T_1;
|
|
967
1019
|
onMergeUseExisting?: T_1 extends true ? boolean : never;
|
|
1020
|
+
templateOptions?: {
|
|
1021
|
+
[x: string]: string;
|
|
1022
|
+
};
|
|
968
1023
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
969
1024
|
maskedPhone: string;
|
|
970
1025
|
}>>;
|
|
971
1026
|
whatsapp: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
|
|
972
1027
|
addToLoginIDs?: T_1;
|
|
973
1028
|
onMergeUseExisting?: T_1 extends true ? boolean : never;
|
|
1029
|
+
templateOptions?: {
|
|
1030
|
+
[x: string]: string;
|
|
1031
|
+
};
|
|
974
1032
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
975
1033
|
maskedPhone: string;
|
|
976
1034
|
}>>;
|
|
@@ -1037,6 +1095,9 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
1037
1095
|
email: <T_2 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
|
|
1038
1096
|
addToLoginIDs?: T_2;
|
|
1039
1097
|
onMergeUseExisting?: T_2 extends true ? boolean : never;
|
|
1098
|
+
templateOptions?: {
|
|
1099
|
+
[x: string]: string;
|
|
1100
|
+
};
|
|
1040
1101
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1041
1102
|
maskedEmail: string;
|
|
1042
1103
|
}>>;
|
|
@@ -1044,12 +1105,18 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
1044
1105
|
sms: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
|
|
1045
1106
|
addToLoginIDs?: T_3;
|
|
1046
1107
|
onMergeUseExisting?: T_3 extends true ? boolean : never;
|
|
1108
|
+
templateOptions?: {
|
|
1109
|
+
[x: string]: string;
|
|
1110
|
+
};
|
|
1047
1111
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1048
1112
|
maskedPhone: string;
|
|
1049
1113
|
}>>;
|
|
1050
1114
|
whatsapp: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
|
|
1051
1115
|
addToLoginIDs?: T_3;
|
|
1052
1116
|
onMergeUseExisting?: T_3 extends true ? boolean : never;
|
|
1117
|
+
templateOptions?: {
|
|
1118
|
+
[x: string]: string;
|
|
1119
|
+
};
|
|
1053
1120
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1054
1121
|
maskedPhone: string;
|
|
1055
1122
|
}>>;
|
|
@@ -1076,6 +1143,9 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
1076
1143
|
email: <T_4 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
|
|
1077
1144
|
addToLoginIDs?: T_4;
|
|
1078
1145
|
onMergeUseExisting?: T_4 extends true ? boolean : never;
|
|
1146
|
+
templateOptions?: {
|
|
1147
|
+
[x: string]: string;
|
|
1148
|
+
};
|
|
1079
1149
|
}) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
|
|
1080
1150
|
};
|
|
1081
1151
|
};
|
|
@@ -1119,7 +1189,9 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
1119
1189
|
phone?: string;
|
|
1120
1190
|
}) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
1121
1191
|
signIn: (loginId: string, password: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
1122
|
-
sendReset: (loginId: string, redirectUrl?: string
|
|
1192
|
+
sendReset: (loginId: string, redirectUrl?: string, templateOptions?: {
|
|
1193
|
+
[x: string]: string;
|
|
1194
|
+
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1123
1195
|
resetMethod: string;
|
|
1124
1196
|
pendingRef?: string;
|
|
1125
1197
|
linkId?: string;
|
|
@@ -1202,10 +1274,11 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
1202
1274
|
samlIdpStateId?: string;
|
|
1203
1275
|
samlIdpUsername?: string;
|
|
1204
1276
|
ssoAppId?: string;
|
|
1277
|
+
oidcLoginHint?: string;
|
|
1205
1278
|
abTestingKey?: number;
|
|
1206
1279
|
startOptionsVersion?: number;
|
|
1207
1280
|
client?: Record<string, any>;
|
|
1208
|
-
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "preview" | "abTestingKey" | "client"> & {
|
|
1281
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client"> & {
|
|
1209
1282
|
lastAuth?: Omit<{
|
|
1210
1283
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
1211
1284
|
oauthProvider?: string;
|
|
@@ -1325,6 +1398,9 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
1325
1398
|
email: <T extends boolean>(loginId: string, email: string, token?: string, updateOptions?: {
|
|
1326
1399
|
addToLoginIDs?: T;
|
|
1327
1400
|
onMergeUseExisting?: T extends true ? boolean : never;
|
|
1401
|
+
templateOptions?: {
|
|
1402
|
+
[x: string]: string;
|
|
1403
|
+
};
|
|
1328
1404
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1329
1405
|
maskedEmail: string;
|
|
1330
1406
|
}>>;
|
|
@@ -1332,12 +1408,18 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
1332
1408
|
sms: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
|
|
1333
1409
|
addToLoginIDs?: T_1;
|
|
1334
1410
|
onMergeUseExisting?: T_1 extends true ? boolean : never;
|
|
1411
|
+
templateOptions?: {
|
|
1412
|
+
[x: string]: string;
|
|
1413
|
+
};
|
|
1335
1414
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1336
1415
|
maskedPhone: string;
|
|
1337
1416
|
}>>;
|
|
1338
1417
|
whatsapp: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
|
|
1339
1418
|
addToLoginIDs?: T_1;
|
|
1340
1419
|
onMergeUseExisting?: T_1 extends true ? boolean : never;
|
|
1420
|
+
templateOptions?: {
|
|
1421
|
+
[x: string]: string;
|
|
1422
|
+
};
|
|
1341
1423
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1342
1424
|
maskedPhone: string;
|
|
1343
1425
|
}>>;
|
|
@@ -1404,6 +1486,9 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
1404
1486
|
email: <T_2 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
|
|
1405
1487
|
addToLoginIDs?: T_2;
|
|
1406
1488
|
onMergeUseExisting?: T_2 extends true ? boolean : never;
|
|
1489
|
+
templateOptions?: {
|
|
1490
|
+
[x: string]: string;
|
|
1491
|
+
};
|
|
1407
1492
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1408
1493
|
maskedEmail: string;
|
|
1409
1494
|
}>>;
|
|
@@ -1411,12 +1496,18 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
1411
1496
|
sms: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
|
|
1412
1497
|
addToLoginIDs?: T_3;
|
|
1413
1498
|
onMergeUseExisting?: T_3 extends true ? boolean : never;
|
|
1499
|
+
templateOptions?: {
|
|
1500
|
+
[x: string]: string;
|
|
1501
|
+
};
|
|
1414
1502
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1415
1503
|
maskedPhone: string;
|
|
1416
1504
|
}>>;
|
|
1417
1505
|
whatsapp: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
|
|
1418
1506
|
addToLoginIDs?: T_3;
|
|
1419
1507
|
onMergeUseExisting?: T_3 extends true ? boolean : never;
|
|
1508
|
+
templateOptions?: {
|
|
1509
|
+
[x: string]: string;
|
|
1510
|
+
};
|
|
1420
1511
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1421
1512
|
maskedPhone: string;
|
|
1422
1513
|
}>>;
|
|
@@ -1443,6 +1534,9 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
1443
1534
|
email: <T_4 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
|
|
1444
1535
|
addToLoginIDs?: T_4;
|
|
1445
1536
|
onMergeUseExisting?: T_4 extends true ? boolean : never;
|
|
1537
|
+
templateOptions?: {
|
|
1538
|
+
[x: string]: string;
|
|
1539
|
+
};
|
|
1446
1540
|
}) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
|
|
1447
1541
|
};
|
|
1448
1542
|
};
|
|
@@ -1486,7 +1580,9 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
|
|
|
1486
1580
|
phone?: string;
|
|
1487
1581
|
}) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
1488
1582
|
signIn: (loginId: string, password: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
1489
|
-
sendReset: (loginId: string, redirectUrl?: string
|
|
1583
|
+
sendReset: (loginId: string, redirectUrl?: string, templateOptions?: {
|
|
1584
|
+
[x: string]: string;
|
|
1585
|
+
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1490
1586
|
resetMethod: string;
|
|
1491
1587
|
pendingRef?: string;
|
|
1492
1588
|
linkId?: string;
|
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e}from"tslib";import t,{wrapWith as n}from"@descope/core-js-sdk";import{load as a}from"@fingerprintjs/fingerprintjs-pro";import i from"js-cookie";const o=(e,t)=>{var n;return["beforeRequest","afterRequest"].reduce(((n,a)=>{var i;return n[a]=[].concat((null===(i=e.hooks)||void 0===i?void 0:i[a])||[]).concat((null==t?void 0:t[a])||[]),n}),null!==(n=e.hooks)&&void 0!==n?n:e.hooks={}),e},s=async e=>{if(!(null==e?void 0:e.ok))return{};const t=await(null==e?void 0:e.clone().json());return(null==t?void 0:t.authInfo)||t||{}},r=async e=>{const t=await s(e);return(null==t?void 0:t.user)||((null==t?void 0:t.hasOwnProperty("userId"))?t:void 0)},l="undefined"!=typeof localStorage,c=(e,t)=>l&&(null===localStorage||void 0===localStorage?void 0:localStorage.setItem(e,t)),u=e=>l&&(null===localStorage||void 0===localStorage?void 0:localStorage.getItem(e)),d=e=>l&&(null===localStorage||void 0===localStorage?void 0:localStorage.removeItem(e)),g=(...e)=>{console.debug(...e)},p="undefined"!=typeof window,f=Math.pow(2,31)-1,w=p&&(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("fingerprint.endpoint.url"))||"https://fp.descope.com",b="fp",h=(e=!1)=>{const t=localStorage.getItem(b);if(!t)return null;const n=JSON.parse(t);return(new Date).getTime()>n.expiry&&!e?null:n.value},v=async e=>{try{if(h())return;const t=(Date.now().toString(36)+Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).substring(0,27),n=a({apiKey:e,endpoint:w}),i=await n,{requestId:o}=await i.get({linkedId:t}),s=((e,t)=>({vsid:e,vrid:t}))(t,o);(e=>{const t={value:e,expiry:(new Date).getTime()+864e5};localStorage.setItem(b,JSON.stringify(t))})(s)}catch(e){global.FB_DEBUG&&console.error(e)}},y=()=>{localStorage.removeItem(b)},m=e=>{const t=h(!0);return t&&e.body&&(e.body.fpData=t),e},S="dls_last_user_login_id",O="dls_last_user_display_name",I=()=>u(S),k=()=>u(O),j=e=>async(...t)=>{var n;t[1]=t[1]||{};const[,a={}]=t,i=I(),o=k();i&&(null!==(n=a.lastAuth)&&void 0!==n||(a.lastAuth={}),a.lastAuth.loginId=i,a.lastAuth.name=o);return await e(...t)},D=e=>async(...t)=>{const n=await e(...t);return d(S),d(O),n};function T(){const e=[];return{pub:t=>{e.forEach((e=>e(t)))},sub:t=>{const n=e.push(t)-1;return()=>e.splice(n,1)}}}const U="DS",A="DSR";const J=(t={},n,a)=>{var{refreshJwt:o,sessionJwt:s}=t,r=e(t,["refreshJwt","sessionJwt"]);void 0===n&&(n=!1),void 0===a&&(a=""),o&&c(`${a}${A}`,o),s&&(n?function(e,t,{cookiePath:n,cookieDomain:a,cookieExpiration:o}){if(t){const s=new Date(1e3*o);i.set(e,t,{path:n,domain:a,expires:s,sameSite:"Strict",secure:!0})}}(U,s,r):c(`${a}${U}`,s))};function $(e=""){return u(`${e}${A}`)||""}function K(e=""){d(`${e}${A}`),d(`${e}${U}`),i.remove(U)}const R=e=>t=>async(...n)=>{const a=await t(...n);return K(e),a};async function x(e){const t=function(e){var t;const n=JSON.parse(e);return n.publicKey.challenge=E(n.publicKey.challenge),n.publicKey.user.id=E(n.publicKey.user.id),null===(t=n.publicKey.excludeCredentials)||void 0===t||t.forEach((e=>{e.id=E(e.id)})),n}(e),n=await navigator.credentials.create(t);return a=n,JSON.stringify({id:a.id,rawId:L(a.rawId),type:a.type,response:{attestationObject:L(a.response.attestationObject),clientDataJSON:L(a.response.clientDataJSON)}});var a}async function C(e){const t=P(e);return q(await navigator.credentials.get(t))}async function N(e,t){const n=P(e);n.signal=t.signal,n.mediation="conditional";return q(await navigator.credentials.get(n))}async function _(e=!1){if(!p)return Promise.resolve(!1);const t=!!(window.PublicKeyCredential&&navigator.credentials&&navigator.credentials.create&&navigator.credentials.get);return t&&e&&PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable?PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable():t}function P(e){var t;const n=JSON.parse(e);return n.publicKey.challenge=E(n.publicKey.challenge),null===(t=n.publicKey.allowCredentials)||void 0===t||t.forEach((e=>{e.id=E(e.id)})),n}function q(e){return JSON.stringify({id:e.id,rawId:L(e.rawId),type:e.type,response:{authenticatorData:L(e.response.authenticatorData),clientDataJSON:L(e.response.clientDataJSON),signature:L(e.response.signature),userHandle:e.response.userHandle?L(e.response.userHandle):void 0}})}function E(e){const t=e.replace(/_/g,"/").replace(/-/g,"+");return Uint8Array.from(atob(t),(e=>e.charCodeAt(0))).buffer}function L(e){return btoa(String.fromCharCode.apply(null,new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}var H,V=(H=e=>({async signUp(t,n){const a=await e.webauthn.signUp.start(t,window.location.origin,n);if(!a.ok)return a;const i=await x(a.data.options);return await e.webauthn.signUp.finish(a.data.transactionId,i)},async signIn(t){const n=await e.webauthn.signIn.start(t,window.location.origin);if(!n.ok)return n;const a=await C(n.data.options);return await e.webauthn.signIn.finish(n.data.transactionId,a)},async signUpOrIn(t){var n;const a=await e.webauthn.signUpOrIn.start(t,window.location.origin);if(!a.ok)return a;if(null===(n=a.data)||void 0===n?void 0:n.create){const t=await x(a.data.options);return await e.webauthn.signUp.finish(a.data.transactionId,t)}{const t=await C(a.data.options);return await e.webauthn.signIn.finish(a.data.transactionId,t)}},async update(t,n){const a=await e.webauthn.update.start(t,window.location.origin,n);if(!a.ok)return a;const i=await x(a.data.options);return await e.webauthn.update.finish(a.data.transactionId,i)},helpers:{create:x,get:C,isSupported:_,conditional:N}}),(...e)=>{const t=H(...e);return Object.assign(t.signUp,e[0].webauthn.signUp),Object.assign(t.signIn,e[0].webauthn.signIn),Object.assign(t.signUpOrIn,e[0].webauthn.signUpOrIn),Object.assign(t.update,e[0].webauthn.update),t});var M=e=>Object.assign(Object.assign({},e.flow),{start:async(...t)=>{const n=await _(),a=Object.assign(Object.assign({location:window.location.href},t[1]),{deviceInfo:{webAuthnSupport:n},startOptionsVersion:1});return t[1]=a,e.flow.start(...t)}});const B=function(...e){return t=>e.reduce(((e,t)=>t(e)),t)}((t=>n=>{var{fpKey:a,fpLoad:i}=n,s=e(n,["fpKey","fpLoad"]);return p?(a&&i&&v(a).catch((()=>null)),t(o(s,{beforeRequest:m}))):(console.warn("Fingerprint is a client side only capability and will not work when running in the server"),t(s))}),(t=>a=>{var{autoRefresh:i}=a,r=e(a,["autoRefresh"]);if(!i)return t(r);const{clearAllTimers:l,setTimer:c}=(()=>{const e=[];return{clearAllTimers:()=>{for(;e.length;)clearTimeout(e.pop())},setTimer:(t,n)=>{e.push(setTimeout(t,n))}}})();let u,d;document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&new Date>u&&(g("Expiration time passed, refreshing session"),p.refresh(d))}));const p=t(o(r,{afterRequest:async(e,t)=>{const{refreshJwt:n,sessionJwt:a}=await s(t);if(401===(null==t?void 0:t.status))g("Received 401, canceling all timers"),l();else if(a){u=(e=>{const t=e.split(".");try{if(3===t.length){const e=JSON.parse(window.atob(t[1]));if(e.exp)return new Date(1e3*e.exp)}}catch(e){}return null})(a),d=n;let e=((i=u)?i.getTime()-(new Date).getTime():0)-2e4;e>f&&(g(`Timeout is too large (${e}ms), setting it to ${f}ms`),e=f),l();const t=new Date(Date.now()+e).toLocaleTimeString("en-US",{hour12:!1});g(`Setting refresh timer for ${t}. (${e}ms)`),c((()=>{g("Refreshing session due to timer"),p.refresh(n)}),e)}var i}}));return n(p,["logout","logoutAll"],(e=>async(...t)=>{const n=await e(...t);return g("Clearing all timers"),l(),n}))}),(e=>t=>e(Object.assign(Object.assign({},t),{baseHeaders:Object.assign({"x-descope-sdk-name":"web-js","x-descope-sdk-version":"1.
|
|
1
|
+
import{__rest as e}from"tslib";import t,{wrapWith as n}from"@descope/core-js-sdk";import{load as a}from"@fingerprintjs/fingerprintjs-pro";import i from"js-cookie";const o=(e,t)=>{var n;return["beforeRequest","afterRequest"].reduce(((n,a)=>{var i;return n[a]=[].concat((null===(i=e.hooks)||void 0===i?void 0:i[a])||[]).concat((null==t?void 0:t[a])||[]),n}),null!==(n=e.hooks)&&void 0!==n?n:e.hooks={}),e},s=async e=>{if(!(null==e?void 0:e.ok))return{};const t=await(null==e?void 0:e.clone().json());return(null==t?void 0:t.authInfo)||t||{}},r=async e=>{const t=await s(e);return(null==t?void 0:t.user)||((null==t?void 0:t.hasOwnProperty("userId"))?t:void 0)},l="undefined"!=typeof localStorage,c=(e,t)=>l&&(null===localStorage||void 0===localStorage?void 0:localStorage.setItem(e,t)),u=e=>l&&(null===localStorage||void 0===localStorage?void 0:localStorage.getItem(e)),d=e=>l&&(null===localStorage||void 0===localStorage?void 0:localStorage.removeItem(e)),g=(...e)=>{console.debug(...e)},p="undefined"!=typeof window,f=Math.pow(2,31)-1,w=p&&(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("fingerprint.endpoint.url"))||"https://fp.descope.com",b="fp",h=(e=!1)=>{const t=localStorage.getItem(b);if(!t)return null;const n=JSON.parse(t);return(new Date).getTime()>n.expiry&&!e?null:n.value},v=async e=>{try{if(h())return;const t=(Date.now().toString(36)+Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).substring(0,27),n=a({apiKey:e,endpoint:w}),i=await n,{requestId:o}=await i.get({linkedId:t}),s=((e,t)=>({vsid:e,vrid:t}))(t,o);(e=>{const t={value:e,expiry:(new Date).getTime()+864e5};localStorage.setItem(b,JSON.stringify(t))})(s)}catch(e){global.FB_DEBUG&&console.error(e)}},y=()=>{localStorage.removeItem(b)},m=e=>{const t=h(!0);return t&&e.body&&(e.body.fpData=t),e},S="dls_last_user_login_id",O="dls_last_user_display_name",I=()=>u(S),k=()=>u(O),j=e=>async(...t)=>{var n;t[1]=t[1]||{};const[,a={}]=t,i=I(),o=k();i&&(null!==(n=a.lastAuth)&&void 0!==n||(a.lastAuth={}),a.lastAuth.loginId=i,a.lastAuth.name=o);return await e(...t)},D=e=>async(...t)=>{const n=await e(...t);return d(S),d(O),n};function T(){const e=[];return{pub:t=>{e.forEach((e=>e(t)))},sub:t=>{const n=e.push(t)-1;return()=>e.splice(n,1)}}}const U="DS",A="DSR";const J=(t={},n,a)=>{var{refreshJwt:o,sessionJwt:s}=t,r=e(t,["refreshJwt","sessionJwt"]);void 0===n&&(n=!1),void 0===a&&(a=""),o&&c(`${a}${A}`,o),s&&(n?function(e,t,{cookiePath:n,cookieDomain:a,cookieExpiration:o}){if(t){const s=new Date(1e3*o);i.set(e,t,{path:n,domain:a,expires:s,sameSite:"Strict",secure:!0})}}(U,s,r):c(`${a}${U}`,s))};function $(e=""){return u(`${e}${A}`)||""}function K(e=""){d(`${e}${A}`),d(`${e}${U}`),i.remove(U)}const R=e=>t=>async(...n)=>{const a=await t(...n);return K(e),a};async function x(e){const t=function(e){var t;const n=JSON.parse(e);return n.publicKey.challenge=E(n.publicKey.challenge),n.publicKey.user.id=E(n.publicKey.user.id),null===(t=n.publicKey.excludeCredentials)||void 0===t||t.forEach((e=>{e.id=E(e.id)})),n}(e),n=await navigator.credentials.create(t);return a=n,JSON.stringify({id:a.id,rawId:L(a.rawId),type:a.type,response:{attestationObject:L(a.response.attestationObject),clientDataJSON:L(a.response.clientDataJSON)}});var a}async function C(e){const t=P(e);return q(await navigator.credentials.get(t))}async function N(e,t){const n=P(e);n.signal=t.signal,n.mediation="conditional";return q(await navigator.credentials.get(n))}async function _(e=!1){if(!p)return Promise.resolve(!1);const t=!!(window.PublicKeyCredential&&navigator.credentials&&navigator.credentials.create&&navigator.credentials.get);return t&&e&&PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable?PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable():t}function P(e){var t;const n=JSON.parse(e);return n.publicKey.challenge=E(n.publicKey.challenge),null===(t=n.publicKey.allowCredentials)||void 0===t||t.forEach((e=>{e.id=E(e.id)})),n}function q(e){return JSON.stringify({id:e.id,rawId:L(e.rawId),type:e.type,response:{authenticatorData:L(e.response.authenticatorData),clientDataJSON:L(e.response.clientDataJSON),signature:L(e.response.signature),userHandle:e.response.userHandle?L(e.response.userHandle):void 0}})}function E(e){const t=e.replace(/_/g,"/").replace(/-/g,"+");return Uint8Array.from(atob(t),(e=>e.charCodeAt(0))).buffer}function L(e){return btoa(String.fromCharCode.apply(null,new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}var H,V=(H=e=>({async signUp(t,n){const a=await e.webauthn.signUp.start(t,window.location.origin,n);if(!a.ok)return a;const i=await x(a.data.options);return await e.webauthn.signUp.finish(a.data.transactionId,i)},async signIn(t){const n=await e.webauthn.signIn.start(t,window.location.origin);if(!n.ok)return n;const a=await C(n.data.options);return await e.webauthn.signIn.finish(n.data.transactionId,a)},async signUpOrIn(t){var n;const a=await e.webauthn.signUpOrIn.start(t,window.location.origin);if(!a.ok)return a;if(null===(n=a.data)||void 0===n?void 0:n.create){const t=await x(a.data.options);return await e.webauthn.signUp.finish(a.data.transactionId,t)}{const t=await C(a.data.options);return await e.webauthn.signIn.finish(a.data.transactionId,t)}},async update(t,n){const a=await e.webauthn.update.start(t,window.location.origin,n);if(!a.ok)return a;const i=await x(a.data.options);return await e.webauthn.update.finish(a.data.transactionId,i)},helpers:{create:x,get:C,isSupported:_,conditional:N}}),(...e)=>{const t=H(...e);return Object.assign(t.signUp,e[0].webauthn.signUp),Object.assign(t.signIn,e[0].webauthn.signIn),Object.assign(t.signUpOrIn,e[0].webauthn.signUpOrIn),Object.assign(t.update,e[0].webauthn.update),t});var M=e=>Object.assign(Object.assign({},e.flow),{start:async(...t)=>{const n=await _(),a=Object.assign(Object.assign({location:window.location.href},t[1]),{deviceInfo:{webAuthnSupport:n},startOptionsVersion:1});return t[1]=a,e.flow.start(...t)}});const B=function(...e){return t=>e.reduce(((e,t)=>t(e)),t)}((t=>n=>{var{fpKey:a,fpLoad:i}=n,s=e(n,["fpKey","fpLoad"]);return p?(a&&i&&v(a).catch((()=>null)),t(o(s,{beforeRequest:m}))):(console.warn("Fingerprint is a client side only capability and will not work when running in the server"),t(s))}),(t=>a=>{var{autoRefresh:i}=a,r=e(a,["autoRefresh"]);if(!i)return t(r);const{clearAllTimers:l,setTimer:c}=(()=>{const e=[];return{clearAllTimers:()=>{for(;e.length;)clearTimeout(e.pop())},setTimer:(t,n)=>{e.push(setTimeout(t,n))}}})();let u,d;document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&new Date>u&&(g("Expiration time passed, refreshing session"),p.refresh(d))}));const p=t(o(r,{afterRequest:async(e,t)=>{const{refreshJwt:n,sessionJwt:a}=await s(t);if(401===(null==t?void 0:t.status))g("Received 401, canceling all timers"),l();else if(a){u=(e=>{const t=e.split(".");try{if(3===t.length){const e=JSON.parse(window.atob(t[1]));if(e.exp)return new Date(1e3*e.exp)}}catch(e){}return null})(a),d=n;let e=((i=u)?i.getTime()-(new Date).getTime():0)-2e4;e>f&&(g(`Timeout is too large (${e}ms), setting it to ${f}ms`),e=f),l();const t=new Date(Date.now()+e).toLocaleTimeString("en-US",{hour12:!1});g(`Setting refresh timer for ${t}. (${e}ms)`),c((()=>{g("Refreshing session due to timer"),p.refresh(n)}),e)}var i}}));return n(p,["logout","logoutAll"],(e=>async(...t)=>{const n=await e(...t);return g("Clearing all timers"),l(),n}))}),(e=>t=>e(Object.assign(Object.assign({},t),{baseHeaders:Object.assign({"x-descope-sdk-name":"web-js","x-descope-sdk-version":"1.9.1"},t.baseHeaders)}))),(e=>t=>{const a=T(),i=T(),l=e(o(t,{afterRequest:async(e,t)=>{if(401===(null==t?void 0:t.status))a.pub(null),i.pub(null);else{const e=await r(t);e&&i.pub(e);const{sessionJwt:n}=await s(t);n&&a.pub(n)}}})),c=n(l,["logout","logoutAll"],(e=>async(...t)=>{const n=await e(...t);return a.pub(null),i.pub(null),n}));return Object.assign(c,{onSessionTokenChange:a.sub,onUserChange:i.sub})}),(e=>t=>{const a=e(o(t,{afterRequest:async(e,t)=>{var n;const a=await r(t),i=null===(n=null==a?void 0:a.loginIds)||void 0===n?void 0:n[0],o=null==a?void 0:a.name;i&&((e=>{c(S,e)})(i),(e=>{c(O,e)})(o))}}));let i=n(a,["flow.start"],j);return i=n(i,["logout","logoutAll"],D),Object.assign(i,{getLastUserLoginId:I,getLastUserDisplayName:k})}),(t=>a=>{var{persistTokens:r,sessionTokenViaCookie:l,storagePrefix:c}=a,d=e(a,["persistTokens","sessionTokenViaCookie","storagePrefix"]);if(!r||!p)return r&&console.warn("Storing auth tokens in local storage and cookies are a client side only capabilities and will not be done when running in the server"),t(d);const g=t(o(d,{beforeRequest:(f=c,e=>Object.assign(e,{token:e.token||$(f)})),afterRequest:async(e,t)=>{401===(null==t?void 0:t.status)?K(c):J(await s(t),l,c)}}));var f;const w=n(g,["logout","logoutAll"],R(c));return Object.assign(w,{getRefreshToken:()=>$(c),getSessionToken:()=>function(e=""){return i.get(U)||u(`${e}${U}`)||""}(c)})}))(((...e)=>{const n=t(...e);return Object.assign(Object.assign({},n),{flow:M(n),webauthn:V(n)})}));export{A as REFRESH_TOKEN_KEY,U as SESSION_TOKEN_KEY,y as clearFingerprintData,B as default,v as ensureFingerprintIds};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|