better-auth 1.2.0-beta.1 → 1.2.0-beta.11
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/adapters/drizzle.cjs +12 -5
- package/dist/adapters/drizzle.d.cts +6 -2
- package/dist/adapters/drizzle.d.ts +6 -2
- package/dist/adapters/drizzle.js +11 -4
- package/dist/adapters/kysely.cjs +5 -5
- package/dist/adapters/kysely.d.cts +6 -2
- package/dist/adapters/kysely.d.ts +6 -2
- package/dist/adapters/kysely.js +3 -3
- package/dist/adapters/memory.cjs +4 -4
- package/dist/adapters/memory.d.cts +6 -2
- package/dist/adapters/memory.d.ts +6 -2
- package/dist/adapters/memory.js +3 -3
- package/dist/adapters/mongodb.cjs +26 -8
- package/dist/adapters/mongodb.d.cts +6 -2
- package/dist/adapters/mongodb.d.ts +6 -2
- package/dist/adapters/mongodb.js +24 -6
- package/dist/adapters/prisma.cjs +18 -5
- package/dist/adapters/prisma.d.cts +6 -2
- package/dist/adapters/prisma.d.ts +6 -2
- package/dist/adapters/prisma.js +16 -3
- package/dist/adapters/test.cjs +1 -1
- package/dist/adapters/test.d.cts +2 -2
- package/dist/adapters/test.d.ts +2 -2
- package/dist/adapters/test.js +1 -1
- package/dist/api.cjs +48 -44
- package/dist/api.d.cts +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/api.js +5 -5
- package/dist/{auth-DcMc3BIq.d.ts → auth-C-uLTIcY.d.ts} +12002 -7646
- package/dist/{auth-D4rdpxtI.d.cts → auth-lDfjrjVd.d.cts} +12002 -7646
- package/dist/{chunk-MGJLVQOV.js → chunk-2OAHQPLI.js} +100 -38
- package/dist/{chunk-5E75URIA.cjs → chunk-2Z6CVQHH.cjs} +0 -4
- package/dist/{chunk-WVLPJXQR.cjs → chunk-3FWLBBDV.cjs} +109 -51
- package/dist/{chunk-WDOY7YUW.cjs → chunk-6P33VPUY.cjs} +106 -44
- package/dist/{chunk-ADGXBH3Y.js → chunk-6XMAWIGH.js} +29 -26
- package/dist/{chunk-G7HOSQ5N.cjs → chunk-75MYIQ34.cjs} +15 -18
- package/dist/{chunk-YW3B2ST3.js → chunk-BY25AMN4.js} +116 -5
- package/dist/{chunk-LZ5DEQVH.cjs → chunk-C4T7TNDG.cjs} +3 -3
- package/dist/{chunk-PJ4KWXLQ.cjs → chunk-DH5E7574.cjs} +8 -8
- package/dist/{chunk-5RY45WFV.js → chunk-DIIVSN3J.js} +36 -13
- package/dist/{chunk-OSBTXYDD.cjs → chunk-GQKBG2VQ.cjs} +125 -14
- package/dist/{chunk-BKFMDM3P.js → chunk-HRI7BYTU.js} +115 -16
- package/dist/{chunk-6O2GLU2U.cjs → chunk-ICONG5HP.cjs} +18 -13
- package/dist/{chunk-3EY3LSQR.js → chunk-IVS5VS3V.js} +75 -36
- package/dist/{chunk-YRUDZRY3.cjs → chunk-IYCSNEDU.cjs} +79 -56
- package/dist/{chunk-NU4SXYJ5.cjs → chunk-JDAHD767.cjs} +198 -42
- package/dist/{chunk-UP6VJQDB.js → chunk-JHLVXVME.js} +17 -10
- package/dist/{chunk-WLXFBYQ6.cjs → chunk-JU56U5MW.cjs} +79 -9
- package/dist/{chunk-QFYRLTM5.cjs → chunk-JYPC7ZAL.cjs} +52 -49
- package/dist/{chunk-UHGAA4GH.cjs → chunk-KNVDJ4WK.cjs} +5 -5
- package/dist/{chunk-CVDYU5OC.js → chunk-M6SPJGF4.js} +5 -8
- package/dist/{chunk-BAPXDO3E.cjs → chunk-MKNA7SED.cjs} +125 -26
- package/dist/{chunk-GTM45OYP.cjs → chunk-NQFRXDEY.cjs} +3 -3
- package/dist/{chunk-FXNG3YQA.js → chunk-NXQP77NI.js} +146 -79
- package/dist/{chunk-FA6UYV37.js → chunk-PR54V2QL.js} +29 -10
- package/dist/{chunk-JLATHUM5.cjs → chunk-QBYD37C7.cjs} +21 -14
- package/dist/{chunk-E6LJZ5ME.js → chunk-QFIG4XKQ.js} +1 -1
- package/dist/{chunk-764RYNTE.cjs → chunk-QS2XIJC4.cjs} +63 -29
- package/dist/{chunk-GTQM7JU7.js → chunk-R42K7GPF.js} +3 -1
- package/dist/{chunk-3BWJXTLC.cjs → chunk-RHWADEUT.cjs} +81 -58
- package/dist/{chunk-JNZYTS3B.js → chunk-RS2A52JD.js} +1 -1
- package/dist/{chunk-5OBRFII2.js → chunk-SIAKIOPW.js} +81 -23
- package/dist/{chunk-V6RGXSG4.cjs → chunk-SVC7H7K4.cjs} +3 -1
- package/dist/{chunk-EM73ZZSP.cjs → chunk-TID6AR5K.cjs} +49 -30
- package/dist/{chunk-VXDYNCOX.js → chunk-TODG5RSV.js} +172 -19
- package/dist/{chunk-VPCROEJW.cjs → chunk-TZ2VLKIG.cjs} +170 -103
- package/dist/{chunk-WGCTQNSQ.js → chunk-UHBMFLSF.js} +1 -1
- package/dist/{chunk-PIWBUHRB.cjs → chunk-UPQLFVFU.cjs} +83 -43
- package/dist/{chunk-B5UCLTPZ.cjs → chunk-UQC2FUXC.cjs} +2 -1
- package/dist/{chunk-RGG6OEA3.js → chunk-VUXQHI6K.js} +60 -26
- package/dist/{chunk-2LQ7T2GE.js → chunk-WUUDJ3TF.js} +3 -3
- package/dist/{chunk-HZBNUY7E.js → chunk-WZ6OIVJK.js} +2 -1
- package/dist/{chunk-5XAVWKUN.js → chunk-X4X6WCXH.js} +74 -4
- package/dist/{chunk-NPO64SVN.js → chunk-ZFUBVSZD.js} +0 -4
- package/dist/{chunk-S6MI7ZLE.js → chunk-ZKNBNGHR.js} +12 -7
- package/dist/{chunk-5KMF6HGF.js → chunk-ZUGWIOG4.js} +75 -52
- package/dist/client/plugins.cjs +215 -21
- package/dist/client/plugins.d.cts +176 -10
- package/dist/client/plugins.d.ts +176 -10
- package/dist/client/plugins.js +214 -14
- package/dist/client.d.cts +6 -7
- package/dist/client.d.ts +6 -7
- package/dist/cookies.d.cts +2 -2
- package/dist/cookies.d.ts +2 -2
- package/dist/db.cjs +29 -29
- package/dist/db.d.cts +6 -6
- package/dist/db.d.ts +6 -6
- package/dist/db.js +3 -3
- package/dist/index-BX_H-j6k.d.cts +7755 -0
- package/dist/{index-Ba5bMY6A.d.cts → index-BuRgaJZR.d.cts} +194 -2
- package/dist/index-D5zWKzf9.d.ts +7755 -0
- package/dist/{index-XrJz4AYF.d.ts → index-moQjyfmm.d.ts} +194 -2
- package/dist/index.cjs +19 -19
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +9 -9
- package/dist/next-js.cjs +24 -24
- package/dist/next-js.d.cts +2 -2
- package/dist/next-js.d.ts +2 -2
- package/dist/next-js.js +23 -23
- package/dist/node.d.cts +2 -2
- package/dist/node.d.ts +2 -2
- package/dist/oauth2.cjs +9 -9
- package/dist/oauth2.d.cts +6 -5
- package/dist/oauth2.d.ts +6 -5
- package/dist/oauth2.js +2 -2
- package/dist/plugins/admin.cjs +7 -7
- package/dist/plugins/admin.d.cts +163 -32
- package/dist/plugins/admin.d.ts +163 -32
- package/dist/plugins/admin.js +6 -6
- package/dist/plugins/anonymous.cjs +7 -7
- package/dist/plugins/anonymous.d.cts +8 -4
- package/dist/plugins/anonymous.d.ts +8 -4
- package/dist/plugins/anonymous.js +6 -6
- package/dist/plugins/bearer.cjs +7 -7
- package/dist/plugins/bearer.d.cts +2 -2
- package/dist/plugins/bearer.d.ts +2 -2
- package/dist/plugins/bearer.js +6 -6
- package/dist/{plugin → plugins}/custom-session.cjs +7 -7
- package/dist/{plugin → plugins}/custom-session.d.cts +8 -4
- package/dist/{plugin → plugins}/custom-session.d.ts +8 -4
- package/dist/{plugin → plugins}/custom-session.js +6 -6
- package/dist/plugins/email-otp.cjs +7 -7
- package/dist/plugins/email-otp.d.cts +44 -16
- package/dist/plugins/email-otp.d.ts +44 -16
- package/dist/plugins/email-otp.js +6 -6
- package/dist/plugins/generic-oauth.cjs +7 -7
- package/dist/plugins/generic-oauth.d.cts +95 -6
- package/dist/plugins/generic-oauth.d.ts +95 -6
- package/dist/plugins/generic-oauth.js +6 -6
- package/dist/plugins/jwt.cjs +7 -7
- package/dist/plugins/jwt.d.cts +28 -6
- package/dist/plugins/jwt.d.ts +28 -6
- package/dist/plugins/jwt.js +6 -6
- package/dist/plugins/magic-link.cjs +7 -7
- package/dist/plugins/magic-link.d.cts +16 -4
- package/dist/plugins/magic-link.d.ts +16 -4
- package/dist/plugins/magic-link.js +6 -6
- package/dist/plugins/multi-session.cjs +7 -7
- package/dist/plugins/multi-session.d.cts +20 -8
- package/dist/plugins/multi-session.d.ts +20 -8
- package/dist/plugins/multi-session.js +6 -6
- package/dist/plugins/oidc-provider.cjs +7 -7
- package/dist/plugins/oidc-provider.d.cts +58 -15
- package/dist/plugins/oidc-provider.d.ts +58 -15
- package/dist/plugins/oidc-provider.js +6 -6
- package/dist/plugins/one-tap.cjs +7 -7
- package/dist/plugins/one-tap.d.cts +13 -2
- package/dist/plugins/one-tap.d.ts +13 -2
- package/dist/plugins/one-tap.js +6 -6
- package/dist/plugins/open-api.cjs +8 -8
- package/dist/plugins/open-api.d.cts +14 -6
- package/dist/plugins/open-api.d.ts +14 -6
- package/dist/plugins/open-api.js +7 -7
- package/dist/plugins/organization.cjs +7 -7
- package/dist/plugins/organization.d.cts +3 -3
- package/dist/plugins/organization.d.ts +3 -3
- package/dist/plugins/organization.js +6 -6
- package/dist/plugins/passkey.cjs +19 -31
- package/dist/plugins/passkey.d.cts +45 -148
- package/dist/plugins/passkey.d.ts +45 -148
- package/dist/plugins/passkey.js +5 -9
- package/dist/plugins/phone-number.cjs +7 -7
- package/dist/plugins/phone-number.d.cts +122 -9
- package/dist/plugins/phone-number.d.ts +122 -9
- package/dist/plugins/phone-number.js +6 -6
- package/dist/plugins/sso.cjs +27 -19
- package/dist/plugins/sso.d.cts +24 -8
- package/dist/plugins/sso.d.ts +24 -8
- package/dist/plugins/sso.js +14 -6
- package/dist/plugins/two-factor.cjs +7 -7
- package/dist/plugins/two-factor.d.cts +62 -22
- package/dist/plugins/two-factor.d.ts +62 -22
- package/dist/plugins/two-factor.js +6 -6
- package/dist/plugins/username.cjs +7 -7
- package/dist/plugins/username.d.cts +36 -4
- package/dist/plugins/username.d.ts +36 -4
- package/dist/plugins/username.js +6 -6
- package/dist/plugins.cjs +43 -43
- package/dist/plugins.d.cts +11 -7
- package/dist/plugins.d.ts +11 -7
- package/dist/plugins.js +23 -23
- package/dist/react.d.cts +7 -9
- package/dist/react.d.ts +7 -9
- package/dist/social.cjs +32 -20
- package/dist/social.d.cts +1 -1
- package/dist/social.d.ts +1 -1
- package/dist/social.js +3 -3
- package/dist/solid.d.cts +7 -7
- package/dist/solid.d.ts +7 -7
- package/dist/{state-Cm8el5M1.d.ts → state-CLmFUxz3.d.ts} +1 -1
- package/dist/{state-DcraY2_H.d.cts → state-CZgzjtR5.d.cts} +1 -1
- package/dist/svelte-kit.d.cts +2 -2
- package/dist/svelte-kit.d.ts +2 -2
- package/dist/svelte.d.cts +7 -7
- package/dist/svelte.d.ts +7 -7
- package/dist/types.d.cts +4 -4
- package/dist/types.d.ts +4 -4
- package/dist/vue.d.cts +7 -7
- package/dist/vue.d.ts +7 -7
- package/package.json +4 -4
- package/dist/chunk-4WCY4Y5J.js +0 -173
- package/dist/chunk-5AZFOKWY.cjs +0 -176
- package/dist/index-CvlKSqnF.d.cts +0 -4023
- package/dist/index-Ivs2EsUL.d.ts +0 -4023
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import * as nanostores from 'nanostores';
|
|
2
|
-
import { atom } from 'nanostores';
|
|
3
|
-
import * as _better_fetch_fetch from '@better-fetch/fetch';
|
|
4
|
-
import { BetterFetch, BetterFetchOption } from '@better-fetch/fetch';
|
|
5
1
|
import * as _simplewebauthn_server from '@simplewebauthn/server';
|
|
6
2
|
import { CredentialDeviceType, PublicKeyCredentialCreationOptionsJSON, AuthenticationResponseJSON } from '@simplewebauthn/server';
|
|
7
3
|
import * as better_call from 'better-call';
|
|
8
4
|
import { z } from 'zod';
|
|
9
|
-
import { I as InferOptionSchema } from '../auth-
|
|
5
|
+
import { I as InferOptionSchema } from '../auth-lDfjrjVd.cjs';
|
|
10
6
|
import 'kysely';
|
|
11
7
|
import '../helper-Bi8FQwDD.cjs';
|
|
12
|
-
import '../index-
|
|
8
|
+
import '../index-BuRgaJZR.cjs';
|
|
13
9
|
import 'jose';
|
|
14
10
|
import 'better-sqlite3';
|
|
15
11
|
|
|
@@ -63,7 +59,7 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
63
59
|
id: "passkey";
|
|
64
60
|
endpoints: {
|
|
65
61
|
generatePasskeyRegistrationOptions: {
|
|
66
|
-
<
|
|
62
|
+
<C extends [({
|
|
67
63
|
body?: undefined;
|
|
68
64
|
method?: "GET" | undefined;
|
|
69
65
|
query?: Record<string, any> | undefined;
|
|
@@ -74,7 +70,11 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
74
70
|
returnHeaders?: boolean | undefined;
|
|
75
71
|
use?: better_call.Middleware[] | undefined;
|
|
76
72
|
path?: string | undefined;
|
|
77
|
-
}
|
|
73
|
+
} | undefined)?]>(...inputCtx: C): Promise<C extends [{
|
|
74
|
+
asResponse: true;
|
|
75
|
+
}] ? Response : C extends [{
|
|
76
|
+
returnHeaders: true;
|
|
77
|
+
}] ? {
|
|
78
78
|
headers: Headers;
|
|
79
79
|
response: PublicKeyCredentialCreationOptionsJSON;
|
|
80
80
|
} : PublicKeyCredentialCreationOptionsJSON>;
|
|
@@ -222,7 +222,7 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
222
222
|
path: "/passkey/generate-register-options";
|
|
223
223
|
};
|
|
224
224
|
generatePasskeyAuthenticationOptions: {
|
|
225
|
-
<
|
|
225
|
+
<C extends [({
|
|
226
226
|
body?: {
|
|
227
227
|
email?: string | undefined;
|
|
228
228
|
} | undefined;
|
|
@@ -235,7 +235,11 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
235
235
|
returnHeaders?: boolean | undefined;
|
|
236
236
|
use?: better_call.Middleware[] | undefined;
|
|
237
237
|
path?: string | undefined;
|
|
238
|
-
}
|
|
238
|
+
} | undefined)?]>(...inputCtx: C): Promise<C extends [{
|
|
239
|
+
asResponse: true;
|
|
240
|
+
}] ? Response : C extends [{
|
|
241
|
+
returnHeaders: true;
|
|
242
|
+
}] ? {
|
|
239
243
|
headers: Headers;
|
|
240
244
|
response: _simplewebauthn_server.PublicKeyCredentialRequestOptionsJSON;
|
|
241
245
|
} : _simplewebauthn_server.PublicKeyCredentialRequestOptionsJSON>;
|
|
@@ -344,7 +348,7 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
344
348
|
path: "/passkey/generate-authenticate-options";
|
|
345
349
|
};
|
|
346
350
|
verifyPasskeyRegistration: {
|
|
347
|
-
<
|
|
351
|
+
<C extends [{
|
|
348
352
|
body: {
|
|
349
353
|
name?: string | undefined;
|
|
350
354
|
response?: any;
|
|
@@ -358,7 +362,11 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
358
362
|
returnHeaders?: boolean | undefined;
|
|
359
363
|
use?: better_call.Middleware[] | undefined;
|
|
360
364
|
path?: string | undefined;
|
|
361
|
-
}>(...inputCtx:
|
|
365
|
+
}]>(...inputCtx: C): Promise<C extends [{
|
|
366
|
+
asResponse: true;
|
|
367
|
+
}] ? Response : C extends [{
|
|
368
|
+
returnHeaders: true;
|
|
369
|
+
}] ? {
|
|
362
370
|
headers: Headers;
|
|
363
371
|
response: Passkey | null;
|
|
364
372
|
} : Passkey | null>;
|
|
@@ -431,7 +439,7 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
431
439
|
path: "/passkey/verify-registration";
|
|
432
440
|
};
|
|
433
441
|
verifyPasskeyAuthentication: {
|
|
434
|
-
<
|
|
442
|
+
<C extends [{
|
|
435
443
|
body: {
|
|
436
444
|
response: AuthenticationResponseJSON;
|
|
437
445
|
};
|
|
@@ -444,7 +452,11 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
444
452
|
returnHeaders?: boolean | undefined;
|
|
445
453
|
use?: better_call.Middleware[] | undefined;
|
|
446
454
|
path?: string | undefined;
|
|
447
|
-
}>(...inputCtx:
|
|
455
|
+
}]>(...inputCtx: C): Promise<C extends [{
|
|
456
|
+
asResponse: true;
|
|
457
|
+
}] ? Response : C extends [{
|
|
458
|
+
returnHeaders: true;
|
|
459
|
+
}] ? {
|
|
448
460
|
headers: Headers;
|
|
449
461
|
response: {
|
|
450
462
|
session: {
|
|
@@ -515,7 +527,7 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
515
527
|
path: "/passkey/verify-authentication";
|
|
516
528
|
};
|
|
517
529
|
listPasskeys: {
|
|
518
|
-
<
|
|
530
|
+
<C extends [({
|
|
519
531
|
body?: undefined;
|
|
520
532
|
method?: "GET" | undefined;
|
|
521
533
|
query?: Record<string, any> | undefined;
|
|
@@ -526,7 +538,11 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
526
538
|
returnHeaders?: boolean | undefined;
|
|
527
539
|
use?: better_call.Middleware[] | undefined;
|
|
528
540
|
path?: string | undefined;
|
|
529
|
-
}
|
|
541
|
+
} | undefined)?]>(...inputCtx: C): Promise<C extends [{
|
|
542
|
+
asResponse: true;
|
|
543
|
+
}] ? Response : C extends [{
|
|
544
|
+
returnHeaders: true;
|
|
545
|
+
}] ? {
|
|
530
546
|
headers: Headers;
|
|
531
547
|
response: Passkey[];
|
|
532
548
|
} : Passkey[]>;
|
|
@@ -569,7 +585,7 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
569
585
|
path: "/passkey/list-user-passkeys";
|
|
570
586
|
};
|
|
571
587
|
deletePasskey: {
|
|
572
|
-
<
|
|
588
|
+
<C extends [{
|
|
573
589
|
body: {
|
|
574
590
|
id: string;
|
|
575
591
|
};
|
|
@@ -582,7 +598,11 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
582
598
|
returnHeaders?: boolean | undefined;
|
|
583
599
|
use?: better_call.Middleware[] | undefined;
|
|
584
600
|
path?: string | undefined;
|
|
585
|
-
}>(...inputCtx:
|
|
601
|
+
}]>(...inputCtx: C): Promise<C extends [{
|
|
602
|
+
asResponse: true;
|
|
603
|
+
}] ? Response : C extends [{
|
|
604
|
+
returnHeaders: true;
|
|
605
|
+
}] ? {
|
|
586
606
|
headers: Headers;
|
|
587
607
|
response: null;
|
|
588
608
|
} : null>;
|
|
@@ -632,7 +652,7 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
632
652
|
path: "/passkey/delete-passkey";
|
|
633
653
|
};
|
|
634
654
|
updatePasskey: {
|
|
635
|
-
<
|
|
655
|
+
<C extends [{
|
|
636
656
|
body: {
|
|
637
657
|
id: string;
|
|
638
658
|
name: string;
|
|
@@ -646,7 +666,11 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
646
666
|
returnHeaders?: boolean | undefined;
|
|
647
667
|
use?: better_call.Middleware[] | undefined;
|
|
648
668
|
path?: string | undefined;
|
|
649
|
-
}>(...inputCtx:
|
|
669
|
+
}]>(...inputCtx: C): Promise<C extends [{
|
|
670
|
+
asResponse: true;
|
|
671
|
+
}] ? Response : C extends [{
|
|
672
|
+
returnHeaders: true;
|
|
673
|
+
}] ? {
|
|
650
674
|
headers: Headers;
|
|
651
675
|
response: {
|
|
652
676
|
passkey: Passkey;
|
|
@@ -806,131 +830,4 @@ declare const schema: {
|
|
|
806
830
|
};
|
|
807
831
|
};
|
|
808
832
|
|
|
809
|
-
|
|
810
|
-
$listPasskeys: ReturnType<typeof atom<any>>;
|
|
811
|
-
}) => {
|
|
812
|
-
signIn: {
|
|
813
|
-
/**
|
|
814
|
-
* Sign in with a registered passkey
|
|
815
|
-
*/
|
|
816
|
-
passkey: (opts?: {
|
|
817
|
-
autoFill?: boolean;
|
|
818
|
-
email?: string;
|
|
819
|
-
fetchOptions?: BetterFetchOption;
|
|
820
|
-
}, options?: BetterFetchOption) => Promise<{
|
|
821
|
-
data: null;
|
|
822
|
-
error: {
|
|
823
|
-
message?: string | undefined;
|
|
824
|
-
status: number;
|
|
825
|
-
statusText: string;
|
|
826
|
-
};
|
|
827
|
-
} | undefined>;
|
|
828
|
-
};
|
|
829
|
-
passkey: {
|
|
830
|
-
/**
|
|
831
|
-
* Add a passkey to the user account
|
|
832
|
-
*/
|
|
833
|
-
addPasskey: (opts?: {
|
|
834
|
-
fetchOptions?: BetterFetchOption;
|
|
835
|
-
/**
|
|
836
|
-
* The name of the passkey. This is used to
|
|
837
|
-
* identify the passkey in the UI.
|
|
838
|
-
*/
|
|
839
|
-
name?: string;
|
|
840
|
-
/**
|
|
841
|
-
* Try to silently create a passkey with the password manager that the user just signed
|
|
842
|
-
* in with.
|
|
843
|
-
* @default false
|
|
844
|
-
*/
|
|
845
|
-
useAutoRegister?: boolean;
|
|
846
|
-
}, fetchOpts?: BetterFetchOption) => Promise<{
|
|
847
|
-
data: null;
|
|
848
|
-
error: {
|
|
849
|
-
message?: string | undefined;
|
|
850
|
-
status: number;
|
|
851
|
-
statusText: string;
|
|
852
|
-
};
|
|
853
|
-
} | undefined>;
|
|
854
|
-
};
|
|
855
|
-
/**
|
|
856
|
-
* Inferred Internal Types
|
|
857
|
-
*/
|
|
858
|
-
$Infer: {
|
|
859
|
-
Passkey: Passkey;
|
|
860
|
-
};
|
|
861
|
-
};
|
|
862
|
-
declare const passkeyClient: () => {
|
|
863
|
-
id: "passkey";
|
|
864
|
-
$InferServerPlugin: ReturnType<typeof passkey>;
|
|
865
|
-
getActions: ($fetch: BetterFetch) => {
|
|
866
|
-
signIn: {
|
|
867
|
-
/**
|
|
868
|
-
* Sign in with a registered passkey
|
|
869
|
-
*/
|
|
870
|
-
passkey: (opts?: {
|
|
871
|
-
autoFill?: boolean;
|
|
872
|
-
email?: string;
|
|
873
|
-
fetchOptions?: BetterFetchOption;
|
|
874
|
-
}, options?: BetterFetchOption) => Promise<{
|
|
875
|
-
data: null;
|
|
876
|
-
error: {
|
|
877
|
-
message?: string | undefined;
|
|
878
|
-
status: number;
|
|
879
|
-
statusText: string;
|
|
880
|
-
};
|
|
881
|
-
} | undefined>;
|
|
882
|
-
};
|
|
883
|
-
passkey: {
|
|
884
|
-
/**
|
|
885
|
-
* Add a passkey to the user account
|
|
886
|
-
*/
|
|
887
|
-
addPasskey: (opts?: {
|
|
888
|
-
fetchOptions?: BetterFetchOption;
|
|
889
|
-
/**
|
|
890
|
-
* The name of the passkey. This is used to
|
|
891
|
-
* identify the passkey in the UI.
|
|
892
|
-
*/
|
|
893
|
-
name?: string;
|
|
894
|
-
/**
|
|
895
|
-
* Try to silently create a passkey with the password manager that the user just signed
|
|
896
|
-
* in with.
|
|
897
|
-
* @default false
|
|
898
|
-
*/
|
|
899
|
-
useAutoRegister?: boolean;
|
|
900
|
-
}, fetchOpts?: BetterFetchOption) => Promise<{
|
|
901
|
-
data: null;
|
|
902
|
-
error: {
|
|
903
|
-
message?: string | undefined;
|
|
904
|
-
status: number;
|
|
905
|
-
statusText: string;
|
|
906
|
-
};
|
|
907
|
-
} | undefined>;
|
|
908
|
-
};
|
|
909
|
-
/**
|
|
910
|
-
* Inferred Internal Types
|
|
911
|
-
*/
|
|
912
|
-
$Infer: {
|
|
913
|
-
Passkey: Passkey;
|
|
914
|
-
};
|
|
915
|
-
};
|
|
916
|
-
getAtoms($fetch: BetterFetch): {
|
|
917
|
-
listPasskeys: nanostores.PreinitializedWritableAtom<{
|
|
918
|
-
data: Passkey[] | null;
|
|
919
|
-
error: null | _better_fetch_fetch.BetterFetchError;
|
|
920
|
-
isPending: boolean;
|
|
921
|
-
isRefetching: boolean;
|
|
922
|
-
refetch: () => void;
|
|
923
|
-
}>;
|
|
924
|
-
$listPasskeys: nanostores.PreinitializedWritableAtom<any>;
|
|
925
|
-
};
|
|
926
|
-
pathMethods: {
|
|
927
|
-
"/passkey/register": "POST";
|
|
928
|
-
"/passkey/authenticate": "POST";
|
|
929
|
-
};
|
|
930
|
-
atomListeners: {
|
|
931
|
-
matcher(path: string): path is "/passkey/verify-registration" | "/passkey/delete-passkey" | "/passkey/update-passkey";
|
|
932
|
-
signal: "_listPasskeys";
|
|
933
|
-
}[];
|
|
934
|
-
};
|
|
935
|
-
|
|
936
|
-
export { type Passkey, type PasskeyOptions, getPasskeyActions, passkey, passkeyClient };
|
|
833
|
+
export { type Passkey, type PasskeyOptions, passkey };
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import * as nanostores from 'nanostores';
|
|
2
|
-
import { atom } from 'nanostores';
|
|
3
|
-
import * as _better_fetch_fetch from '@better-fetch/fetch';
|
|
4
|
-
import { BetterFetch, BetterFetchOption } from '@better-fetch/fetch';
|
|
5
1
|
import * as _simplewebauthn_server from '@simplewebauthn/server';
|
|
6
2
|
import { CredentialDeviceType, PublicKeyCredentialCreationOptionsJSON, AuthenticationResponseJSON } from '@simplewebauthn/server';
|
|
7
3
|
import * as better_call from 'better-call';
|
|
8
4
|
import { z } from 'zod';
|
|
9
|
-
import { I as InferOptionSchema } from '../auth-
|
|
5
|
+
import { I as InferOptionSchema } from '../auth-C-uLTIcY.js';
|
|
10
6
|
import 'kysely';
|
|
11
7
|
import '../helper-Bi8FQwDD.js';
|
|
12
|
-
import '../index-
|
|
8
|
+
import '../index-moQjyfmm.js';
|
|
13
9
|
import 'jose';
|
|
14
10
|
import 'better-sqlite3';
|
|
15
11
|
|
|
@@ -63,7 +59,7 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
63
59
|
id: "passkey";
|
|
64
60
|
endpoints: {
|
|
65
61
|
generatePasskeyRegistrationOptions: {
|
|
66
|
-
<
|
|
62
|
+
<C extends [({
|
|
67
63
|
body?: undefined;
|
|
68
64
|
method?: "GET" | undefined;
|
|
69
65
|
query?: Record<string, any> | undefined;
|
|
@@ -74,7 +70,11 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
74
70
|
returnHeaders?: boolean | undefined;
|
|
75
71
|
use?: better_call.Middleware[] | undefined;
|
|
76
72
|
path?: string | undefined;
|
|
77
|
-
}
|
|
73
|
+
} | undefined)?]>(...inputCtx: C): Promise<C extends [{
|
|
74
|
+
asResponse: true;
|
|
75
|
+
}] ? Response : C extends [{
|
|
76
|
+
returnHeaders: true;
|
|
77
|
+
}] ? {
|
|
78
78
|
headers: Headers;
|
|
79
79
|
response: PublicKeyCredentialCreationOptionsJSON;
|
|
80
80
|
} : PublicKeyCredentialCreationOptionsJSON>;
|
|
@@ -222,7 +222,7 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
222
222
|
path: "/passkey/generate-register-options";
|
|
223
223
|
};
|
|
224
224
|
generatePasskeyAuthenticationOptions: {
|
|
225
|
-
<
|
|
225
|
+
<C extends [({
|
|
226
226
|
body?: {
|
|
227
227
|
email?: string | undefined;
|
|
228
228
|
} | undefined;
|
|
@@ -235,7 +235,11 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
235
235
|
returnHeaders?: boolean | undefined;
|
|
236
236
|
use?: better_call.Middleware[] | undefined;
|
|
237
237
|
path?: string | undefined;
|
|
238
|
-
}
|
|
238
|
+
} | undefined)?]>(...inputCtx: C): Promise<C extends [{
|
|
239
|
+
asResponse: true;
|
|
240
|
+
}] ? Response : C extends [{
|
|
241
|
+
returnHeaders: true;
|
|
242
|
+
}] ? {
|
|
239
243
|
headers: Headers;
|
|
240
244
|
response: _simplewebauthn_server.PublicKeyCredentialRequestOptionsJSON;
|
|
241
245
|
} : _simplewebauthn_server.PublicKeyCredentialRequestOptionsJSON>;
|
|
@@ -344,7 +348,7 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
344
348
|
path: "/passkey/generate-authenticate-options";
|
|
345
349
|
};
|
|
346
350
|
verifyPasskeyRegistration: {
|
|
347
|
-
<
|
|
351
|
+
<C extends [{
|
|
348
352
|
body: {
|
|
349
353
|
name?: string | undefined;
|
|
350
354
|
response?: any;
|
|
@@ -358,7 +362,11 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
358
362
|
returnHeaders?: boolean | undefined;
|
|
359
363
|
use?: better_call.Middleware[] | undefined;
|
|
360
364
|
path?: string | undefined;
|
|
361
|
-
}>(...inputCtx:
|
|
365
|
+
}]>(...inputCtx: C): Promise<C extends [{
|
|
366
|
+
asResponse: true;
|
|
367
|
+
}] ? Response : C extends [{
|
|
368
|
+
returnHeaders: true;
|
|
369
|
+
}] ? {
|
|
362
370
|
headers: Headers;
|
|
363
371
|
response: Passkey | null;
|
|
364
372
|
} : Passkey | null>;
|
|
@@ -431,7 +439,7 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
431
439
|
path: "/passkey/verify-registration";
|
|
432
440
|
};
|
|
433
441
|
verifyPasskeyAuthentication: {
|
|
434
|
-
<
|
|
442
|
+
<C extends [{
|
|
435
443
|
body: {
|
|
436
444
|
response: AuthenticationResponseJSON;
|
|
437
445
|
};
|
|
@@ -444,7 +452,11 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
444
452
|
returnHeaders?: boolean | undefined;
|
|
445
453
|
use?: better_call.Middleware[] | undefined;
|
|
446
454
|
path?: string | undefined;
|
|
447
|
-
}>(...inputCtx:
|
|
455
|
+
}]>(...inputCtx: C): Promise<C extends [{
|
|
456
|
+
asResponse: true;
|
|
457
|
+
}] ? Response : C extends [{
|
|
458
|
+
returnHeaders: true;
|
|
459
|
+
}] ? {
|
|
448
460
|
headers: Headers;
|
|
449
461
|
response: {
|
|
450
462
|
session: {
|
|
@@ -515,7 +527,7 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
515
527
|
path: "/passkey/verify-authentication";
|
|
516
528
|
};
|
|
517
529
|
listPasskeys: {
|
|
518
|
-
<
|
|
530
|
+
<C extends [({
|
|
519
531
|
body?: undefined;
|
|
520
532
|
method?: "GET" | undefined;
|
|
521
533
|
query?: Record<string, any> | undefined;
|
|
@@ -526,7 +538,11 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
526
538
|
returnHeaders?: boolean | undefined;
|
|
527
539
|
use?: better_call.Middleware[] | undefined;
|
|
528
540
|
path?: string | undefined;
|
|
529
|
-
}
|
|
541
|
+
} | undefined)?]>(...inputCtx: C): Promise<C extends [{
|
|
542
|
+
asResponse: true;
|
|
543
|
+
}] ? Response : C extends [{
|
|
544
|
+
returnHeaders: true;
|
|
545
|
+
}] ? {
|
|
530
546
|
headers: Headers;
|
|
531
547
|
response: Passkey[];
|
|
532
548
|
} : Passkey[]>;
|
|
@@ -569,7 +585,7 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
569
585
|
path: "/passkey/list-user-passkeys";
|
|
570
586
|
};
|
|
571
587
|
deletePasskey: {
|
|
572
|
-
<
|
|
588
|
+
<C extends [{
|
|
573
589
|
body: {
|
|
574
590
|
id: string;
|
|
575
591
|
};
|
|
@@ -582,7 +598,11 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
582
598
|
returnHeaders?: boolean | undefined;
|
|
583
599
|
use?: better_call.Middleware[] | undefined;
|
|
584
600
|
path?: string | undefined;
|
|
585
|
-
}>(...inputCtx:
|
|
601
|
+
}]>(...inputCtx: C): Promise<C extends [{
|
|
602
|
+
asResponse: true;
|
|
603
|
+
}] ? Response : C extends [{
|
|
604
|
+
returnHeaders: true;
|
|
605
|
+
}] ? {
|
|
586
606
|
headers: Headers;
|
|
587
607
|
response: null;
|
|
588
608
|
} : null>;
|
|
@@ -632,7 +652,7 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
632
652
|
path: "/passkey/delete-passkey";
|
|
633
653
|
};
|
|
634
654
|
updatePasskey: {
|
|
635
|
-
<
|
|
655
|
+
<C extends [{
|
|
636
656
|
body: {
|
|
637
657
|
id: string;
|
|
638
658
|
name: string;
|
|
@@ -646,7 +666,11 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
646
666
|
returnHeaders?: boolean | undefined;
|
|
647
667
|
use?: better_call.Middleware[] | undefined;
|
|
648
668
|
path?: string | undefined;
|
|
649
|
-
}>(...inputCtx:
|
|
669
|
+
}]>(...inputCtx: C): Promise<C extends [{
|
|
670
|
+
asResponse: true;
|
|
671
|
+
}] ? Response : C extends [{
|
|
672
|
+
returnHeaders: true;
|
|
673
|
+
}] ? {
|
|
650
674
|
headers: Headers;
|
|
651
675
|
response: {
|
|
652
676
|
passkey: Passkey;
|
|
@@ -806,131 +830,4 @@ declare const schema: {
|
|
|
806
830
|
};
|
|
807
831
|
};
|
|
808
832
|
|
|
809
|
-
|
|
810
|
-
$listPasskeys: ReturnType<typeof atom<any>>;
|
|
811
|
-
}) => {
|
|
812
|
-
signIn: {
|
|
813
|
-
/**
|
|
814
|
-
* Sign in with a registered passkey
|
|
815
|
-
*/
|
|
816
|
-
passkey: (opts?: {
|
|
817
|
-
autoFill?: boolean;
|
|
818
|
-
email?: string;
|
|
819
|
-
fetchOptions?: BetterFetchOption;
|
|
820
|
-
}, options?: BetterFetchOption) => Promise<{
|
|
821
|
-
data: null;
|
|
822
|
-
error: {
|
|
823
|
-
message?: string | undefined;
|
|
824
|
-
status: number;
|
|
825
|
-
statusText: string;
|
|
826
|
-
};
|
|
827
|
-
} | undefined>;
|
|
828
|
-
};
|
|
829
|
-
passkey: {
|
|
830
|
-
/**
|
|
831
|
-
* Add a passkey to the user account
|
|
832
|
-
*/
|
|
833
|
-
addPasskey: (opts?: {
|
|
834
|
-
fetchOptions?: BetterFetchOption;
|
|
835
|
-
/**
|
|
836
|
-
* The name of the passkey. This is used to
|
|
837
|
-
* identify the passkey in the UI.
|
|
838
|
-
*/
|
|
839
|
-
name?: string;
|
|
840
|
-
/**
|
|
841
|
-
* Try to silently create a passkey with the password manager that the user just signed
|
|
842
|
-
* in with.
|
|
843
|
-
* @default false
|
|
844
|
-
*/
|
|
845
|
-
useAutoRegister?: boolean;
|
|
846
|
-
}, fetchOpts?: BetterFetchOption) => Promise<{
|
|
847
|
-
data: null;
|
|
848
|
-
error: {
|
|
849
|
-
message?: string | undefined;
|
|
850
|
-
status: number;
|
|
851
|
-
statusText: string;
|
|
852
|
-
};
|
|
853
|
-
} | undefined>;
|
|
854
|
-
};
|
|
855
|
-
/**
|
|
856
|
-
* Inferred Internal Types
|
|
857
|
-
*/
|
|
858
|
-
$Infer: {
|
|
859
|
-
Passkey: Passkey;
|
|
860
|
-
};
|
|
861
|
-
};
|
|
862
|
-
declare const passkeyClient: () => {
|
|
863
|
-
id: "passkey";
|
|
864
|
-
$InferServerPlugin: ReturnType<typeof passkey>;
|
|
865
|
-
getActions: ($fetch: BetterFetch) => {
|
|
866
|
-
signIn: {
|
|
867
|
-
/**
|
|
868
|
-
* Sign in with a registered passkey
|
|
869
|
-
*/
|
|
870
|
-
passkey: (opts?: {
|
|
871
|
-
autoFill?: boolean;
|
|
872
|
-
email?: string;
|
|
873
|
-
fetchOptions?: BetterFetchOption;
|
|
874
|
-
}, options?: BetterFetchOption) => Promise<{
|
|
875
|
-
data: null;
|
|
876
|
-
error: {
|
|
877
|
-
message?: string | undefined;
|
|
878
|
-
status: number;
|
|
879
|
-
statusText: string;
|
|
880
|
-
};
|
|
881
|
-
} | undefined>;
|
|
882
|
-
};
|
|
883
|
-
passkey: {
|
|
884
|
-
/**
|
|
885
|
-
* Add a passkey to the user account
|
|
886
|
-
*/
|
|
887
|
-
addPasskey: (opts?: {
|
|
888
|
-
fetchOptions?: BetterFetchOption;
|
|
889
|
-
/**
|
|
890
|
-
* The name of the passkey. This is used to
|
|
891
|
-
* identify the passkey in the UI.
|
|
892
|
-
*/
|
|
893
|
-
name?: string;
|
|
894
|
-
/**
|
|
895
|
-
* Try to silently create a passkey with the password manager that the user just signed
|
|
896
|
-
* in with.
|
|
897
|
-
* @default false
|
|
898
|
-
*/
|
|
899
|
-
useAutoRegister?: boolean;
|
|
900
|
-
}, fetchOpts?: BetterFetchOption) => Promise<{
|
|
901
|
-
data: null;
|
|
902
|
-
error: {
|
|
903
|
-
message?: string | undefined;
|
|
904
|
-
status: number;
|
|
905
|
-
statusText: string;
|
|
906
|
-
};
|
|
907
|
-
} | undefined>;
|
|
908
|
-
};
|
|
909
|
-
/**
|
|
910
|
-
* Inferred Internal Types
|
|
911
|
-
*/
|
|
912
|
-
$Infer: {
|
|
913
|
-
Passkey: Passkey;
|
|
914
|
-
};
|
|
915
|
-
};
|
|
916
|
-
getAtoms($fetch: BetterFetch): {
|
|
917
|
-
listPasskeys: nanostores.PreinitializedWritableAtom<{
|
|
918
|
-
data: Passkey[] | null;
|
|
919
|
-
error: null | _better_fetch_fetch.BetterFetchError;
|
|
920
|
-
isPending: boolean;
|
|
921
|
-
isRefetching: boolean;
|
|
922
|
-
refetch: () => void;
|
|
923
|
-
}>;
|
|
924
|
-
$listPasskeys: nanostores.PreinitializedWritableAtom<any>;
|
|
925
|
-
};
|
|
926
|
-
pathMethods: {
|
|
927
|
-
"/passkey/register": "POST";
|
|
928
|
-
"/passkey/authenticate": "POST";
|
|
929
|
-
};
|
|
930
|
-
atomListeners: {
|
|
931
|
-
matcher(path: string): path is "/passkey/verify-registration" | "/passkey/delete-passkey" | "/passkey/update-passkey";
|
|
932
|
-
signal: "_listPasskeys";
|
|
933
|
-
}[];
|
|
934
|
-
};
|
|
935
|
-
|
|
936
|
-
export { type Passkey, type PasskeyOptions, getPasskeyActions, passkey, passkeyClient };
|
|
833
|
+
export { type Passkey, type PasskeyOptions, passkey };
|
package/dist/plugins/passkey.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-GTQM7JU7.js';
|
|
5
|
-
import '../chunk-7KKMYVNZ.js';
|
|
6
|
-
import '../chunk-QUVBQTGS.js';
|
|
7
|
-
import '../chunk-HVHN3Y2L.js';
|
|
1
|
+
import { createAuthEndpoint, freshSessionMiddleware, getSessionFromCtx, sessionMiddleware } from '../chunk-IVS5VS3V.js';
|
|
2
|
+
import '../chunk-TODG5RSV.js';
|
|
3
|
+
import '../chunk-R42K7GPF.js';
|
|
8
4
|
import '../chunk-XFCIANZX.js';
|
|
9
5
|
import { setSessionCookie } from '../chunk-QQGZ3XGI.js';
|
|
10
|
-
import { mergeSchema } from '../chunk-
|
|
6
|
+
import { mergeSchema } from '../chunk-WZ6OIVJK.js';
|
|
11
7
|
import { generateId } from '../chunk-KLDFBLYL.js';
|
|
12
|
-
import '../chunk-
|
|
8
|
+
import '../chunk-ZFUBVSZD.js';
|
|
13
9
|
import '../chunk-3XTQSPPA.js';
|
|
14
10
|
import { generateRandomString } from '../chunk-DBPOZRMS.js';
|
|
15
11
|
import '../chunk-53IPO2PJ.js';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
3
|
+
var chunkMKNA7SED_cjs = require('../chunk-MKNA7SED.cjs');
|
|
4
|
+
require('../chunk-UPQLFVFU.cjs');
|
|
5
|
+
require('../chunk-JDAHD767.cjs');
|
|
6
|
+
require('../chunk-SVC7H7K4.cjs');
|
|
7
7
|
require('../chunk-S5UORXJH.cjs');
|
|
8
8
|
require('../chunk-V6HE2MP7.cjs');
|
|
9
|
-
require('../chunk-
|
|
9
|
+
require('../chunk-UQC2FUXC.cjs');
|
|
10
10
|
require('../chunk-H74YRRNV.cjs');
|
|
11
|
-
require('../chunk-
|
|
11
|
+
require('../chunk-2Z6CVQHH.cjs');
|
|
12
12
|
require('../chunk-CCKQSGIR.cjs');
|
|
13
13
|
require('../chunk-G2LZ73E2.cjs');
|
|
14
14
|
require('../chunk-OA7Z7IZT.cjs');
|
|
@@ -20,5 +20,5 @@ require('../chunk-PEZRSDZS.cjs');
|
|
|
20
20
|
|
|
21
21
|
Object.defineProperty(exports, "phoneNumber", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkMKNA7SED_cjs.phoneNumber; }
|
|
24
24
|
});
|