better-auth 1.2.6-beta.7 → 1.2.7-beta.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/adapters/drizzle-adapter/index.cjs +186 -249
- package/dist/adapters/drizzle-adapter/index.d.cts +11 -49
- package/dist/adapters/drizzle-adapter/index.d.mts +11 -49
- package/dist/adapters/drizzle-adapter/index.d.ts +11 -49
- package/dist/adapters/drizzle-adapter/index.mjs +186 -249
- package/dist/adapters/index.cjs +26 -0
- package/dist/adapters/index.d.cts +17 -0
- package/dist/adapters/index.d.mts +17 -0
- package/dist/adapters/index.d.ts +17 -0
- package/dist/adapters/index.mjs +20 -0
- package/dist/adapters/kysely-adapter/index.cjs +7 -7
- package/dist/adapters/kysely-adapter/index.d.cts +17 -49
- package/dist/adapters/kysely-adapter/index.d.mts +17 -49
- package/dist/adapters/kysely-adapter/index.d.ts +17 -49
- package/dist/adapters/kysely-adapter/index.mjs +8 -8
- package/dist/adapters/memory-adapter/index.cjs +7 -8
- package/dist/adapters/memory-adapter/index.d.cts +9 -49
- package/dist/adapters/memory-adapter/index.d.mts +9 -49
- package/dist/adapters/memory-adapter/index.d.ts +9 -49
- package/dist/adapters/memory-adapter/index.mjs +8 -9
- package/dist/adapters/mongodb-adapter/index.cjs +2 -2
- package/dist/adapters/mongodb-adapter/index.d.cts +4 -4
- package/dist/adapters/mongodb-adapter/index.d.mts +4 -4
- package/dist/adapters/mongodb-adapter/index.d.ts +4 -4
- package/dist/adapters/mongodb-adapter/index.mjs +3 -3
- package/dist/adapters/prisma-adapter/index.cjs +130 -203
- package/dist/adapters/prisma-adapter/index.d.cts +17 -49
- package/dist/adapters/prisma-adapter/index.d.mts +17 -49
- package/dist/adapters/prisma-adapter/index.d.ts +17 -49
- package/dist/adapters/prisma-adapter/index.mjs +131 -204
- package/dist/adapters/test.cjs +710 -377
- package/dist/adapters/test.d.cts +64 -5
- package/dist/adapters/test.d.mts +64 -5
- package/dist/adapters/test.d.ts +64 -5
- package/dist/adapters/test.mjs +712 -380
- package/dist/api/index.cjs +61 -25
- package/dist/api/index.d.cts +3 -3
- package/dist/api/index.d.mts +3 -3
- package/dist/api/index.d.ts +3 -3
- package/dist/api/index.mjs +63 -27
- package/dist/client/index.d.cts +3 -3
- package/dist/client/index.d.mts +3 -3
- package/dist/client/index.d.ts +3 -3
- package/dist/client/plugins/index.cjs +13 -15
- package/dist/client/plugins/index.d.cts +80 -19
- package/dist/client/plugins/index.d.mts +80 -19
- package/dist/client/plugins/index.d.ts +80 -19
- package/dist/client/plugins/index.mjs +13 -16
- package/dist/client/react/index.cjs +4 -4
- package/dist/client/react/index.d.cts +3 -3
- package/dist/client/react/index.d.mts +3 -3
- package/dist/client/react/index.d.ts +3 -3
- package/dist/client/solid/index.d.cts +3 -3
- package/dist/client/solid/index.d.mts +3 -3
- package/dist/client/solid/index.d.ts +3 -3
- package/dist/client/svelte/index.d.cts +3 -3
- package/dist/client/svelte/index.d.mts +3 -3
- package/dist/client/svelte/index.d.ts +3 -3
- package/dist/client/vue/index.d.cts +3 -3
- package/dist/client/vue/index.d.mts +3 -3
- package/dist/client/vue/index.d.ts +3 -3
- package/dist/cookies/index.cjs +13 -2
- package/dist/cookies/index.d.cts +3 -3
- package/dist/cookies/index.d.mts +3 -3
- package/dist/cookies/index.d.ts +3 -3
- package/dist/cookies/index.mjs +13 -2
- package/dist/db/index.cjs +6 -5
- package/dist/db/index.d.cts +4 -4
- package/dist/db/index.d.mts +4 -4
- package/dist/db/index.d.ts +4 -4
- package/dist/db/index.mjs +7 -6
- package/dist/index.cjs +11 -7
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +14 -10
- package/dist/integrations/next-js.cjs +4 -5
- package/dist/integrations/next-js.d.cts +3 -3
- package/dist/integrations/next-js.d.mts +3 -3
- package/dist/integrations/next-js.d.ts +3 -3
- package/dist/integrations/next-js.mjs +5 -6
- package/dist/integrations/node.d.cts +3 -3
- package/dist/integrations/node.d.mts +3 -3
- package/dist/integrations/node.d.ts +3 -3
- package/dist/integrations/react-start.cjs +5 -6
- package/dist/integrations/react-start.d.cts +3 -3
- package/dist/integrations/react-start.d.mts +3 -3
- package/dist/integrations/react-start.d.ts +3 -3
- package/dist/integrations/react-start.mjs +6 -7
- package/dist/integrations/svelte-kit.d.cts +3 -3
- package/dist/integrations/svelte-kit.d.mts +3 -3
- package/dist/integrations/svelte-kit.d.ts +3 -3
- package/dist/oauth2/index.d.cts +5 -5
- package/dist/oauth2/index.d.mts +5 -5
- package/dist/oauth2/index.d.ts +5 -5
- package/dist/plugins/access/index.d.cts +1 -1
- package/dist/plugins/access/index.d.mts +1 -1
- package/dist/plugins/access/index.d.ts +1 -1
- package/dist/plugins/admin/access/index.d.cts +1 -1
- package/dist/plugins/admin/access/index.d.mts +1 -1
- package/dist/plugins/admin/access/index.d.ts +1 -1
- package/dist/plugins/admin/index.cjs +4 -4
- package/dist/plugins/admin/index.d.cts +74 -14
- package/dist/plugins/admin/index.d.mts +74 -14
- package/dist/plugins/admin/index.d.ts +74 -14
- package/dist/plugins/admin/index.mjs +5 -5
- package/dist/plugins/anonymous/index.cjs +4 -5
- package/dist/plugins/anonymous/index.d.cts +3 -3
- package/dist/plugins/anonymous/index.d.mts +3 -3
- package/dist/plugins/anonymous/index.d.ts +3 -3
- package/dist/plugins/anonymous/index.mjs +5 -6
- package/dist/plugins/bearer/index.cjs +2 -2
- package/dist/plugins/bearer/index.d.cts +3 -3
- package/dist/plugins/bearer/index.d.mts +3 -3
- package/dist/plugins/bearer/index.d.ts +3 -3
- package/dist/plugins/bearer/index.mjs +3 -3
- package/dist/plugins/captcha/index.cjs +110 -45
- package/dist/plugins/captcha/index.d.cts +26 -6
- package/dist/plugins/captcha/index.d.mts +26 -6
- package/dist/plugins/captcha/index.d.ts +26 -6
- package/dist/plugins/captcha/index.mjs +110 -45
- package/dist/plugins/custom-session/index.cjs +24 -5
- package/dist/plugins/custom-session/index.d.cts +25 -6
- package/dist/plugins/custom-session/index.d.mts +25 -6
- package/dist/plugins/custom-session/index.d.ts +25 -6
- package/dist/plugins/custom-session/index.mjs +25 -6
- package/dist/plugins/email-otp/index.cjs +96 -30
- package/dist/plugins/email-otp/index.d.cts +33 -10
- package/dist/plugins/email-otp/index.d.mts +33 -10
- package/dist/plugins/email-otp/index.d.ts +33 -10
- package/dist/plugins/email-otp/index.mjs +97 -31
- package/dist/plugins/generic-oauth/index.cjs +81 -20
- package/dist/plugins/generic-oauth/index.d.cts +46 -3
- package/dist/plugins/generic-oauth/index.d.mts +46 -3
- package/dist/plugins/generic-oauth/index.d.ts +46 -3
- package/dist/plugins/generic-oauth/index.mjs +82 -21
- package/dist/plugins/haveibeenpwned/index.cjs +98 -0
- package/dist/plugins/haveibeenpwned/index.d.cts +36 -0
- package/dist/plugins/haveibeenpwned/index.d.mts +36 -0
- package/dist/plugins/haveibeenpwned/index.d.ts +36 -0
- package/dist/plugins/haveibeenpwned/index.mjs +96 -0
- package/dist/plugins/index.cjs +583 -19
- package/dist/plugins/index.d.cts +7 -5
- package/dist/plugins/index.d.mts +7 -5
- package/dist/plugins/index.d.ts +7 -5
- package/dist/plugins/index.mjs +583 -21
- package/dist/plugins/jwt/index.cjs +45 -21
- package/dist/plugins/jwt/index.d.cts +52 -6
- package/dist/plugins/jwt/index.d.mts +52 -6
- package/dist/plugins/jwt/index.d.ts +52 -6
- package/dist/plugins/jwt/index.mjs +46 -22
- package/dist/plugins/magic-link/index.cjs +3 -3
- package/dist/plugins/magic-link/index.mjs +4 -4
- package/dist/plugins/multi-session/index.cjs +3 -3
- package/dist/plugins/multi-session/index.d.cts +3 -3
- package/dist/plugins/multi-session/index.d.mts +3 -3
- package/dist/plugins/multi-session/index.d.ts +3 -3
- package/dist/plugins/multi-session/index.mjs +4 -4
- package/dist/plugins/oauth-proxy/index.cjs +4 -4
- package/dist/plugins/oauth-proxy/index.d.cts +3 -3
- package/dist/plugins/oauth-proxy/index.d.mts +3 -3
- package/dist/plugins/oauth-proxy/index.d.ts +3 -3
- package/dist/plugins/oauth-proxy/index.mjs +5 -5
- package/dist/plugins/oidc-provider/index.cjs +227 -8
- package/dist/plugins/oidc-provider/index.d.cts +215 -3
- package/dist/plugins/oidc-provider/index.d.mts +215 -3
- package/dist/plugins/oidc-provider/index.d.ts +215 -3
- package/dist/plugins/oidc-provider/index.mjs +228 -9
- package/dist/plugins/one-tap/index.cjs +5 -5
- package/dist/plugins/one-tap/index.mjs +6 -6
- package/dist/plugins/one-time-token/index.cjs +119 -0
- package/dist/plugins/one-time-token/index.d.cts +134 -0
- package/dist/plugins/one-time-token/index.d.mts +134 -0
- package/dist/plugins/one-time-token/index.d.ts +134 -0
- package/dist/plugins/one-time-token/index.mjs +117 -0
- package/dist/plugins/open-api/index.cjs +3 -3
- package/dist/plugins/open-api/index.d.cts +3 -3
- package/dist/plugins/open-api/index.d.mts +3 -3
- package/dist/plugins/open-api/index.d.ts +3 -3
- package/dist/plugins/open-api/index.mjs +4 -4
- package/dist/plugins/organization/access/index.d.cts +1 -1
- package/dist/plugins/organization/access/index.d.mts +1 -1
- package/dist/plugins/organization/access/index.d.ts +1 -1
- package/dist/plugins/organization/index.cjs +4 -4
- package/dist/plugins/organization/index.d.cts +708 -55
- package/dist/plugins/organization/index.d.mts +708 -55
- package/dist/plugins/organization/index.d.ts +708 -55
- package/dist/plugins/organization/index.mjs +5 -5
- package/dist/plugins/passkey/index.cjs +82 -8
- package/dist/plugins/passkey/index.d.cts +72 -3
- package/dist/plugins/passkey/index.d.mts +72 -3
- package/dist/plugins/passkey/index.d.ts +72 -3
- package/dist/plugins/passkey/index.mjs +83 -9
- package/dist/plugins/phone-number/index.cjs +194 -26
- package/dist/plugins/phone-number/index.d.cts +132 -8
- package/dist/plugins/phone-number/index.d.mts +132 -8
- package/dist/plugins/phone-number/index.d.ts +132 -8
- package/dist/plugins/phone-number/index.mjs +195 -27
- package/dist/plugins/sso/index.cjs +190 -7
- package/dist/plugins/sso/index.d.cts +181 -15
- package/dist/plugins/sso/index.d.mts +181 -15
- package/dist/plugins/sso/index.d.ts +181 -15
- package/dist/plugins/sso/index.mjs +191 -8
- package/dist/plugins/two-factor/index.cjs +443 -92
- package/dist/plugins/two-factor/index.d.cts +230 -396
- package/dist/plugins/two-factor/index.d.mts +230 -396
- package/dist/plugins/two-factor/index.d.ts +230 -396
- package/dist/plugins/two-factor/index.mjs +431 -80
- package/dist/plugins/username/index.cjs +34 -31
- package/dist/plugins/username/index.d.cts +15 -12
- package/dist/plugins/username/index.d.mts +15 -12
- package/dist/plugins/username/index.d.ts +15 -12
- package/dist/plugins/username/index.mjs +35 -32
- package/dist/shared/better-auth.1DR6suCQ.mjs +307 -0
- package/dist/shared/{better-auth.BSsp73pg.cjs → better-auth.B7cZ2juS.cjs} +15 -14
- package/dist/shared/{better-auth.bKwabe3I.d.mts → better-auth.B88xucNq.d.mts} +529 -39
- package/dist/shared/{better-auth.CApEjVDP.cjs → better-auth.BW8BpneG.cjs} +4 -1
- package/dist/shared/{better-auth.BiQsvaIP.d.cts → better-auth.BcU1Kjyq.d.cts} +2051 -518
- package/dist/shared/better-auth.BfG24BjZ.cjs +118 -0
- package/dist/shared/{better-auth.A3TjrU8G.mjs → better-auth.Bk5IMdhM.mjs} +32 -12
- package/dist/shared/{better-auth.D9VnBkRI.mjs → better-auth.Bm9HxIzE.mjs} +47 -24
- package/dist/shared/{better-auth.BRf6Iynu.d.ts → better-auth.Bwc-6kOr.d.ts} +1 -1
- package/dist/shared/{better-auth.D-oLmHIj.d.mts → better-auth.CA2hFK4N.d.ts} +2051 -518
- package/dist/shared/{better-auth.Dmhe30iW.d.mts → better-auth.CGukGrxT.d.cts} +1 -1
- package/dist/shared/{better-auth.CsSpq0zL.cjs → better-auth.CHUzBidy.cjs} +46 -23
- package/dist/shared/{better-auth.DWRligF8.d.cts → better-auth.CT9J6rD-.d.cts} +539 -7
- package/dist/shared/better-auth.CVCo5Z2T.cjs +310 -0
- package/dist/shared/{better-auth.D4jH-sJA.mjs → better-auth.CWwVo_61.mjs} +458 -118
- package/dist/shared/{better-auth.Bi8FQwDD.d.cts → better-auth.CYegVoq1.d.cts} +1 -1
- package/dist/shared/{better-auth.Bi8FQwDD.d.mts → better-auth.CYegVoq1.d.mts} +1 -1
- package/dist/shared/{better-auth.Bi8FQwDD.d.ts → better-auth.CYegVoq1.d.ts} +1 -1
- package/dist/shared/{better-auth.CepcSj5H.mjs → better-auth.Cc72UxUH.mjs} +1 -2
- package/dist/shared/{better-auth.BWp5dztg.d.ts → better-auth.CmN4mlPh.d.ts} +539 -7
- package/dist/shared/{better-auth.DH3YjMQH.mjs → better-auth.Cqykj82J.mjs} +1 -1
- package/dist/shared/{better-auth.wcdMj2cT.d.mts → better-auth.DIt2e3lu.d.mts} +539 -7
- package/dist/shared/{better-auth.BANAxdkL.d.ts → better-auth.DNTAFSt1.d.ts} +529 -39
- package/dist/shared/{better-auth.DU2QNVc_.d.ts → better-auth.DQ7OSJbI.d.mts} +2051 -518
- package/dist/shared/{better-auth.DLTzKoOS.cjs → better-auth.DSVbLSt7.cjs} +4 -1
- package/dist/shared/{better-auth.B2Fw1vhH.d.cts → better-auth.DTiSPWEk.d.cts} +529 -39
- package/dist/shared/better-auth.DURsStt9.mjs +116 -0
- package/dist/shared/{better-auth.BIjcZ_vt.cjs → better-auth.DYoLD99C.cjs} +31 -11
- package/dist/shared/{better-auth.CV1L7TPV.cjs → better-auth.D_ZIX1O8.cjs} +317 -47
- package/dist/shared/{better-auth.C5H9XEzZ.cjs → better-auth.DcWKCjjf.cjs} +1 -2
- package/dist/shared/{better-auth.BDYXUcLv.cjs → better-auth.Dg0siV5C.cjs} +457 -117
- package/dist/shared/better-auth.DjryM8pE.cjs +760 -0
- package/dist/shared/{better-auth.DPBQN9Fs.mjs → better-auth.Dn_Ms1Uf.mjs} +318 -48
- package/dist/shared/{better-auth.DiG4KL2x.mjs → better-auth.OuYYTHC7.mjs} +4 -1
- package/dist/shared/{better-auth.DtC8i3pf.d.cts → better-auth.S1jimRbX.d.mts} +1 -1
- package/dist/shared/better-auth.SPmq4a4z.d.mts +344 -0
- package/dist/shared/{better-auth.cOCrlspr.mjs → better-auth.bkwPl2G4.mjs} +4 -1
- package/dist/shared/better-auth.cp2rC2iM.d.ts +344 -0
- package/dist/shared/better-auth.eVy4DZvP.d.cts +344 -0
- package/dist/shared/{better-auth.BrOpzmqo.mjs → better-auth.iKoUsdFE.mjs} +15 -14
- package/dist/shared/better-auth.rSYJCd3o.mjs +758 -0
- package/dist/social-providers/index.cjs +75 -3
- package/dist/social-providers/index.d.cts +2 -2
- package/dist/social-providers/index.d.mts +2 -2
- package/dist/social-providers/index.d.ts +2 -2
- package/dist/social-providers/index.mjs +77 -6
- package/dist/types/index.d.cts +4 -4
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.d.ts +4 -4
- package/package.json +42 -5
- package/dist/chunks/server.cjs +0 -905
- package/dist/chunks/server.mjs +0 -895
- package/dist/shared/better-auth.BcoSd9tC.mjs +0 -10
- package/dist/shared/better-auth.BnRFp-t0.mjs +0 -405
- package/dist/shared/better-auth.C1-vpKly.cjs +0 -12
- package/dist/shared/better-auth.ClTSOgiD.mjs +0 -140
- package/dist/shared/better-auth.DC8JQbiE.mjs +0 -173
- package/dist/shared/better-auth.DWHWPllD.cjs +0 -175
- package/dist/shared/better-auth.DqLjzBlO.cjs +0 -408
- package/dist/shared/better-auth.m575EIBC.cjs +0 -144
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { o as organization, p as parseRoles } from '../../shared/better-auth.
|
|
1
|
+
export { o as organization, p as parseRoles } from '../../shared/better-auth.Dn_Ms1Uf.mjs';
|
|
2
2
|
import 'better-call';
|
|
3
3
|
import 'zod';
|
|
4
|
-
import '../../shared/better-auth.
|
|
4
|
+
import '../../shared/better-auth.CWwVo_61.mjs';
|
|
5
5
|
import '../../cookies/index.mjs';
|
|
6
6
|
import '../../shared/better-auth.DdzSJf-n.mjs';
|
|
7
7
|
import '../../shared/better-auth.CW6D9eSx.mjs';
|
|
@@ -24,15 +24,15 @@ import '@better-auth/utils/hex';
|
|
|
24
24
|
import '@noble/hashes/utils';
|
|
25
25
|
import '../../shared/better-auth.B4Qoxdgc.mjs';
|
|
26
26
|
import '@better-auth/utils/random';
|
|
27
|
-
import '../../shared/better-auth.
|
|
27
|
+
import '../../shared/better-auth.Cqykj82J.mjs';
|
|
28
28
|
import '../../shared/better-auth.BdyOG_p4.mjs';
|
|
29
29
|
import '../../shared/better-auth.BUPPRXfK.mjs';
|
|
30
|
-
import '../../shared/better-auth.
|
|
30
|
+
import '../../shared/better-auth.Cc72UxUH.mjs';
|
|
31
31
|
import 'defu';
|
|
32
32
|
import '../../shared/better-auth.DDEbWX-S.mjs';
|
|
33
33
|
import 'jose/errors';
|
|
34
34
|
import '@better-auth/utils/binary';
|
|
35
35
|
import '../../shared/better-auth.ffWeg50w.mjs';
|
|
36
|
-
import '../../shared/better-auth.
|
|
36
|
+
import '../../shared/better-auth.OuYYTHC7.mjs';
|
|
37
37
|
import './access/index.mjs';
|
|
38
38
|
import '../access/index.mjs';
|
|
@@ -4,9 +4,9 @@ const server = require('@simplewebauthn/server');
|
|
|
4
4
|
const betterCall = require('better-call');
|
|
5
5
|
const random = require('../../shared/better-auth.CYeOI8C-.cjs');
|
|
6
6
|
const zod = require('zod');
|
|
7
|
-
const refreshToken = require('../../shared/better-auth.
|
|
7
|
+
const refreshToken = require('../../shared/better-auth.Dg0siV5C.cjs');
|
|
8
8
|
const cookies_index = require('../../cookies/index.cjs');
|
|
9
|
-
const schema$1 = require('../../shared/better-auth.
|
|
9
|
+
const schema$1 = require('../../shared/better-auth.DcWKCjjf.cjs');
|
|
10
10
|
require('../../shared/better-auth.DiSjtgs9.cjs');
|
|
11
11
|
require('../../shared/better-auth.GpOOav9x.cjs');
|
|
12
12
|
require('defu');
|
|
@@ -28,11 +28,11 @@ require('../../shared/better-auth.Cm29ZKNJ.cjs');
|
|
|
28
28
|
require('../../shared/better-auth.C1hdVENX.cjs');
|
|
29
29
|
require('../../shared/better-auth.ANpbi45u.cjs');
|
|
30
30
|
require('../../shared/better-auth.QbbyHMYf.cjs');
|
|
31
|
+
require('../../shared/better-auth.D3mtHEZg.cjs');
|
|
31
32
|
require('@better-auth/utils/hmac');
|
|
32
33
|
require('../../shared/better-auth.BMYo0QR-.cjs');
|
|
33
34
|
require('../../shared/better-auth.C-R0J0n1.cjs');
|
|
34
35
|
require('jose/errors');
|
|
35
|
-
require('../../shared/better-auth.D3mtHEZg.cjs');
|
|
36
36
|
require('@better-auth/utils/binary');
|
|
37
37
|
|
|
38
38
|
function getRpID(options, baseURL) {
|
|
@@ -504,7 +504,6 @@ const passkey = (options) => {
|
|
|
504
504
|
const newPasskey = {
|
|
505
505
|
name: ctx.body.name,
|
|
506
506
|
userId: userData.id,
|
|
507
|
-
id: ctx.context.generateId({ model: "passkey" }),
|
|
508
507
|
credentialID: credential.id,
|
|
509
508
|
publicKey: pubKey,
|
|
510
509
|
counter: credential.counter,
|
|
@@ -644,7 +643,7 @@ const passkey = (options) => {
|
|
|
644
643
|
});
|
|
645
644
|
const s = await ctx.context.internalAdapter.createSession(
|
|
646
645
|
passkey2.userId,
|
|
647
|
-
ctx.
|
|
646
|
+
ctx.headers
|
|
648
647
|
);
|
|
649
648
|
if (!s) {
|
|
650
649
|
throw new betterCall.APIError("INTERNAL_SERVER_ERROR", {
|
|
@@ -683,7 +682,35 @@ const passkey = (options) => {
|
|
|
683
682
|
"/passkey/list-user-passkeys",
|
|
684
683
|
{
|
|
685
684
|
method: "GET",
|
|
686
|
-
use: [refreshToken.sessionMiddleware]
|
|
685
|
+
use: [refreshToken.sessionMiddleware],
|
|
686
|
+
metadata: {
|
|
687
|
+
openapi: {
|
|
688
|
+
description: "List all passkeys for the authenticated user",
|
|
689
|
+
responses: {
|
|
690
|
+
"200": {
|
|
691
|
+
description: "Passkeys retrieved successfully",
|
|
692
|
+
content: {
|
|
693
|
+
"application/json": {
|
|
694
|
+
schema: {
|
|
695
|
+
type: "array",
|
|
696
|
+
items: {
|
|
697
|
+
$ref: "#/components/schemas/Passkey",
|
|
698
|
+
required: [
|
|
699
|
+
"id",
|
|
700
|
+
"userId",
|
|
701
|
+
"publicKey",
|
|
702
|
+
"createdAt",
|
|
703
|
+
"updatedAt"
|
|
704
|
+
]
|
|
705
|
+
},
|
|
706
|
+
description: "Array of passkey objects associated with the user"
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
}
|
|
687
714
|
},
|
|
688
715
|
async (ctx) => {
|
|
689
716
|
const passkeys = await ctx.context.adapter.findMany({
|
|
@@ -702,7 +729,31 @@ const passkey = (options) => {
|
|
|
702
729
|
body: zod.z.object({
|
|
703
730
|
id: zod.z.string()
|
|
704
731
|
}),
|
|
705
|
-
use: [refreshToken.sessionMiddleware]
|
|
732
|
+
use: [refreshToken.sessionMiddleware],
|
|
733
|
+
metadata: {
|
|
734
|
+
openapi: {
|
|
735
|
+
description: "Delete a specific passkey",
|
|
736
|
+
responses: {
|
|
737
|
+
"200": {
|
|
738
|
+
description: "Passkey deleted successfully",
|
|
739
|
+
content: {
|
|
740
|
+
"application/json": {
|
|
741
|
+
schema: {
|
|
742
|
+
type: "object",
|
|
743
|
+
properties: {
|
|
744
|
+
status: {
|
|
745
|
+
type: "boolean",
|
|
746
|
+
description: "Indicates whether the deletion was successful"
|
|
747
|
+
}
|
|
748
|
+
},
|
|
749
|
+
required: ["status"]
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
}
|
|
706
757
|
},
|
|
707
758
|
async (ctx) => {
|
|
708
759
|
await ctx.context.adapter.delete({
|
|
@@ -727,7 +778,30 @@ const passkey = (options) => {
|
|
|
727
778
|
id: zod.z.string(),
|
|
728
779
|
name: zod.z.string()
|
|
729
780
|
}),
|
|
730
|
-
use: [refreshToken.sessionMiddleware]
|
|
781
|
+
use: [refreshToken.sessionMiddleware],
|
|
782
|
+
metadata: {
|
|
783
|
+
openapi: {
|
|
784
|
+
description: "Update a specific passkey's name",
|
|
785
|
+
responses: {
|
|
786
|
+
"200": {
|
|
787
|
+
description: "Passkey updated successfully",
|
|
788
|
+
content: {
|
|
789
|
+
"application/json": {
|
|
790
|
+
schema: {
|
|
791
|
+
type: "object",
|
|
792
|
+
properties: {
|
|
793
|
+
passkey: {
|
|
794
|
+
$ref: "#/components/schemas/Passkey"
|
|
795
|
+
}
|
|
796
|
+
},
|
|
797
|
+
required: ["passkey"]
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
}
|
|
731
805
|
},
|
|
732
806
|
async (ctx) => {
|
|
733
807
|
const passkey2 = await ctx.context.adapter.findOne({
|
|
@@ -2,9 +2,9 @@ import * as _simplewebauthn_server from '@simplewebauthn/server';
|
|
|
2
2
|
import { CredentialDeviceType, PublicKeyCredentialCreationOptionsJSON, AuthenticationResponseJSON } from '@simplewebauthn/server';
|
|
3
3
|
import * as better_call from 'better-call';
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import { I as InferOptionSchema } from '../../shared/better-auth.
|
|
6
|
-
import '../../shared/better-auth.
|
|
7
|
-
import '../../shared/better-auth.
|
|
5
|
+
import { I as InferOptionSchema } from '../../shared/better-auth.BcU1Kjyq.cjs';
|
|
6
|
+
import '../../shared/better-auth.CYegVoq1.cjs';
|
|
7
|
+
import '../../shared/better-auth.DTiSPWEk.cjs';
|
|
8
8
|
import 'jose';
|
|
9
9
|
import 'kysely';
|
|
10
10
|
import 'better-sqlite3';
|
|
@@ -602,6 +602,28 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
602
602
|
};
|
|
603
603
|
};
|
|
604
604
|
}>)[];
|
|
605
|
+
metadata: {
|
|
606
|
+
openapi: {
|
|
607
|
+
description: string;
|
|
608
|
+
responses: {
|
|
609
|
+
"200": {
|
|
610
|
+
description: string;
|
|
611
|
+
content: {
|
|
612
|
+
"application/json": {
|
|
613
|
+
schema: {
|
|
614
|
+
type: "array";
|
|
615
|
+
items: {
|
|
616
|
+
$ref: string;
|
|
617
|
+
required: string[];
|
|
618
|
+
};
|
|
619
|
+
description: string;
|
|
620
|
+
};
|
|
621
|
+
};
|
|
622
|
+
};
|
|
623
|
+
};
|
|
624
|
+
};
|
|
625
|
+
};
|
|
626
|
+
};
|
|
605
627
|
} & {
|
|
606
628
|
use: any[];
|
|
607
629
|
};
|
|
@@ -666,6 +688,30 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
666
688
|
};
|
|
667
689
|
};
|
|
668
690
|
}>)[];
|
|
691
|
+
metadata: {
|
|
692
|
+
openapi: {
|
|
693
|
+
description: string;
|
|
694
|
+
responses: {
|
|
695
|
+
"200": {
|
|
696
|
+
description: string;
|
|
697
|
+
content: {
|
|
698
|
+
"application/json": {
|
|
699
|
+
schema: {
|
|
700
|
+
type: "object";
|
|
701
|
+
properties: {
|
|
702
|
+
status: {
|
|
703
|
+
type: string;
|
|
704
|
+
description: string;
|
|
705
|
+
};
|
|
706
|
+
};
|
|
707
|
+
required: string[];
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
};
|
|
711
|
+
};
|
|
712
|
+
};
|
|
713
|
+
};
|
|
714
|
+
};
|
|
669
715
|
} & {
|
|
670
716
|
use: any[];
|
|
671
717
|
};
|
|
@@ -738,6 +784,29 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
738
784
|
};
|
|
739
785
|
};
|
|
740
786
|
}>)[];
|
|
787
|
+
metadata: {
|
|
788
|
+
openapi: {
|
|
789
|
+
description: string;
|
|
790
|
+
responses: {
|
|
791
|
+
"200": {
|
|
792
|
+
description: string;
|
|
793
|
+
content: {
|
|
794
|
+
"application/json": {
|
|
795
|
+
schema: {
|
|
796
|
+
type: "object";
|
|
797
|
+
properties: {
|
|
798
|
+
passkey: {
|
|
799
|
+
$ref: string;
|
|
800
|
+
};
|
|
801
|
+
};
|
|
802
|
+
required: string[];
|
|
803
|
+
};
|
|
804
|
+
};
|
|
805
|
+
};
|
|
806
|
+
};
|
|
807
|
+
};
|
|
808
|
+
};
|
|
809
|
+
};
|
|
741
810
|
} & {
|
|
742
811
|
use: any[];
|
|
743
812
|
};
|
|
@@ -2,9 +2,9 @@ import * as _simplewebauthn_server from '@simplewebauthn/server';
|
|
|
2
2
|
import { CredentialDeviceType, PublicKeyCredentialCreationOptionsJSON, AuthenticationResponseJSON } from '@simplewebauthn/server';
|
|
3
3
|
import * as better_call from 'better-call';
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import { I as InferOptionSchema } from '../../shared/better-auth.
|
|
6
|
-
import '../../shared/better-auth.
|
|
7
|
-
import '../../shared/better-auth.
|
|
5
|
+
import { I as InferOptionSchema } from '../../shared/better-auth.DQ7OSJbI.mjs';
|
|
6
|
+
import '../../shared/better-auth.CYegVoq1.mjs';
|
|
7
|
+
import '../../shared/better-auth.B88xucNq.mjs';
|
|
8
8
|
import 'jose';
|
|
9
9
|
import 'kysely';
|
|
10
10
|
import 'better-sqlite3';
|
|
@@ -602,6 +602,28 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
602
602
|
};
|
|
603
603
|
};
|
|
604
604
|
}>)[];
|
|
605
|
+
metadata: {
|
|
606
|
+
openapi: {
|
|
607
|
+
description: string;
|
|
608
|
+
responses: {
|
|
609
|
+
"200": {
|
|
610
|
+
description: string;
|
|
611
|
+
content: {
|
|
612
|
+
"application/json": {
|
|
613
|
+
schema: {
|
|
614
|
+
type: "array";
|
|
615
|
+
items: {
|
|
616
|
+
$ref: string;
|
|
617
|
+
required: string[];
|
|
618
|
+
};
|
|
619
|
+
description: string;
|
|
620
|
+
};
|
|
621
|
+
};
|
|
622
|
+
};
|
|
623
|
+
};
|
|
624
|
+
};
|
|
625
|
+
};
|
|
626
|
+
};
|
|
605
627
|
} & {
|
|
606
628
|
use: any[];
|
|
607
629
|
};
|
|
@@ -666,6 +688,30 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
666
688
|
};
|
|
667
689
|
};
|
|
668
690
|
}>)[];
|
|
691
|
+
metadata: {
|
|
692
|
+
openapi: {
|
|
693
|
+
description: string;
|
|
694
|
+
responses: {
|
|
695
|
+
"200": {
|
|
696
|
+
description: string;
|
|
697
|
+
content: {
|
|
698
|
+
"application/json": {
|
|
699
|
+
schema: {
|
|
700
|
+
type: "object";
|
|
701
|
+
properties: {
|
|
702
|
+
status: {
|
|
703
|
+
type: string;
|
|
704
|
+
description: string;
|
|
705
|
+
};
|
|
706
|
+
};
|
|
707
|
+
required: string[];
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
};
|
|
711
|
+
};
|
|
712
|
+
};
|
|
713
|
+
};
|
|
714
|
+
};
|
|
669
715
|
} & {
|
|
670
716
|
use: any[];
|
|
671
717
|
};
|
|
@@ -738,6 +784,29 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
738
784
|
};
|
|
739
785
|
};
|
|
740
786
|
}>)[];
|
|
787
|
+
metadata: {
|
|
788
|
+
openapi: {
|
|
789
|
+
description: string;
|
|
790
|
+
responses: {
|
|
791
|
+
"200": {
|
|
792
|
+
description: string;
|
|
793
|
+
content: {
|
|
794
|
+
"application/json": {
|
|
795
|
+
schema: {
|
|
796
|
+
type: "object";
|
|
797
|
+
properties: {
|
|
798
|
+
passkey: {
|
|
799
|
+
$ref: string;
|
|
800
|
+
};
|
|
801
|
+
};
|
|
802
|
+
required: string[];
|
|
803
|
+
};
|
|
804
|
+
};
|
|
805
|
+
};
|
|
806
|
+
};
|
|
807
|
+
};
|
|
808
|
+
};
|
|
809
|
+
};
|
|
741
810
|
} & {
|
|
742
811
|
use: any[];
|
|
743
812
|
};
|
|
@@ -2,9 +2,9 @@ import * as _simplewebauthn_server from '@simplewebauthn/server';
|
|
|
2
2
|
import { CredentialDeviceType, PublicKeyCredentialCreationOptionsJSON, AuthenticationResponseJSON } from '@simplewebauthn/server';
|
|
3
3
|
import * as better_call from 'better-call';
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import { I as InferOptionSchema } from '../../shared/better-auth.
|
|
6
|
-
import '../../shared/better-auth.
|
|
7
|
-
import '../../shared/better-auth.
|
|
5
|
+
import { I as InferOptionSchema } from '../../shared/better-auth.CA2hFK4N.js';
|
|
6
|
+
import '../../shared/better-auth.CYegVoq1.js';
|
|
7
|
+
import '../../shared/better-auth.DNTAFSt1.js';
|
|
8
8
|
import 'jose';
|
|
9
9
|
import 'kysely';
|
|
10
10
|
import 'better-sqlite3';
|
|
@@ -602,6 +602,28 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
602
602
|
};
|
|
603
603
|
};
|
|
604
604
|
}>)[];
|
|
605
|
+
metadata: {
|
|
606
|
+
openapi: {
|
|
607
|
+
description: string;
|
|
608
|
+
responses: {
|
|
609
|
+
"200": {
|
|
610
|
+
description: string;
|
|
611
|
+
content: {
|
|
612
|
+
"application/json": {
|
|
613
|
+
schema: {
|
|
614
|
+
type: "array";
|
|
615
|
+
items: {
|
|
616
|
+
$ref: string;
|
|
617
|
+
required: string[];
|
|
618
|
+
};
|
|
619
|
+
description: string;
|
|
620
|
+
};
|
|
621
|
+
};
|
|
622
|
+
};
|
|
623
|
+
};
|
|
624
|
+
};
|
|
625
|
+
};
|
|
626
|
+
};
|
|
605
627
|
} & {
|
|
606
628
|
use: any[];
|
|
607
629
|
};
|
|
@@ -666,6 +688,30 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
666
688
|
};
|
|
667
689
|
};
|
|
668
690
|
}>)[];
|
|
691
|
+
metadata: {
|
|
692
|
+
openapi: {
|
|
693
|
+
description: string;
|
|
694
|
+
responses: {
|
|
695
|
+
"200": {
|
|
696
|
+
description: string;
|
|
697
|
+
content: {
|
|
698
|
+
"application/json": {
|
|
699
|
+
schema: {
|
|
700
|
+
type: "object";
|
|
701
|
+
properties: {
|
|
702
|
+
status: {
|
|
703
|
+
type: string;
|
|
704
|
+
description: string;
|
|
705
|
+
};
|
|
706
|
+
};
|
|
707
|
+
required: string[];
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
};
|
|
711
|
+
};
|
|
712
|
+
};
|
|
713
|
+
};
|
|
714
|
+
};
|
|
669
715
|
} & {
|
|
670
716
|
use: any[];
|
|
671
717
|
};
|
|
@@ -738,6 +784,29 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
738
784
|
};
|
|
739
785
|
};
|
|
740
786
|
}>)[];
|
|
787
|
+
metadata: {
|
|
788
|
+
openapi: {
|
|
789
|
+
description: string;
|
|
790
|
+
responses: {
|
|
791
|
+
"200": {
|
|
792
|
+
description: string;
|
|
793
|
+
content: {
|
|
794
|
+
"application/json": {
|
|
795
|
+
schema: {
|
|
796
|
+
type: "object";
|
|
797
|
+
properties: {
|
|
798
|
+
passkey: {
|
|
799
|
+
$ref: string;
|
|
800
|
+
};
|
|
801
|
+
};
|
|
802
|
+
required: string[];
|
|
803
|
+
};
|
|
804
|
+
};
|
|
805
|
+
};
|
|
806
|
+
};
|
|
807
|
+
};
|
|
808
|
+
};
|
|
809
|
+
};
|
|
741
810
|
} & {
|
|
742
811
|
use: any[];
|
|
743
812
|
};
|
|
@@ -2,11 +2,11 @@ import { verifyAuthenticationResponse, verifyRegistrationResponse, generateAuthe
|
|
|
2
2
|
import { APIError } from 'better-call';
|
|
3
3
|
import { g as generateRandomString } from '../../shared/better-auth.B4Qoxdgc.mjs';
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import { a as createAuthEndpoint, s as sessionMiddleware, f as freshSessionMiddleware, g as getSessionFromCtx } from '../../shared/better-auth.
|
|
5
|
+
import { a as createAuthEndpoint, s as sessionMiddleware, f as freshSessionMiddleware, g as getSessionFromCtx } from '../../shared/better-auth.CWwVo_61.mjs';
|
|
6
6
|
import { setSessionCookie } from '../../cookies/index.mjs';
|
|
7
|
-
import { m as mergeSchema } from '../../shared/better-auth.
|
|
7
|
+
import { m as mergeSchema } from '../../shared/better-auth.Cc72UxUH.mjs';
|
|
8
8
|
import '../../shared/better-auth.8zoxzg-F.mjs';
|
|
9
|
-
import '../../shared/better-auth.
|
|
9
|
+
import '../../shared/better-auth.Cqykj82J.mjs';
|
|
10
10
|
import 'defu';
|
|
11
11
|
import { g as generateId } from '../../shared/better-auth.BUPPRXfK.mjs';
|
|
12
12
|
import '@better-auth/utils/hash';
|
|
@@ -26,11 +26,11 @@ import '../../shared/better-auth.DCVeP5-W.mjs';
|
|
|
26
26
|
import '../../shared/better-auth.CW6D9eSx.mjs';
|
|
27
27
|
import '../../shared/better-auth.DdzSJf-n.mjs';
|
|
28
28
|
import '../../shared/better-auth.BdyOG_p4.mjs';
|
|
29
|
+
import '../../shared/better-auth.tB5eU6EY.mjs';
|
|
29
30
|
import '@better-auth/utils/hmac';
|
|
30
31
|
import '../../shared/better-auth.DDEbWX-S.mjs';
|
|
31
32
|
import '../../shared/better-auth.VTXNLFMT.mjs';
|
|
32
33
|
import 'jose/errors';
|
|
33
|
-
import '../../shared/better-auth.tB5eU6EY.mjs';
|
|
34
34
|
import '@better-auth/utils/binary';
|
|
35
35
|
|
|
36
36
|
function getRpID(options, baseURL) {
|
|
@@ -502,7 +502,6 @@ const passkey = (options) => {
|
|
|
502
502
|
const newPasskey = {
|
|
503
503
|
name: ctx.body.name,
|
|
504
504
|
userId: userData.id,
|
|
505
|
-
id: ctx.context.generateId({ model: "passkey" }),
|
|
506
505
|
credentialID: credential.id,
|
|
507
506
|
publicKey: pubKey,
|
|
508
507
|
counter: credential.counter,
|
|
@@ -642,7 +641,7 @@ const passkey = (options) => {
|
|
|
642
641
|
});
|
|
643
642
|
const s = await ctx.context.internalAdapter.createSession(
|
|
644
643
|
passkey2.userId,
|
|
645
|
-
ctx.
|
|
644
|
+
ctx.headers
|
|
646
645
|
);
|
|
647
646
|
if (!s) {
|
|
648
647
|
throw new APIError("INTERNAL_SERVER_ERROR", {
|
|
@@ -681,7 +680,35 @@ const passkey = (options) => {
|
|
|
681
680
|
"/passkey/list-user-passkeys",
|
|
682
681
|
{
|
|
683
682
|
method: "GET",
|
|
684
|
-
use: [sessionMiddleware]
|
|
683
|
+
use: [sessionMiddleware],
|
|
684
|
+
metadata: {
|
|
685
|
+
openapi: {
|
|
686
|
+
description: "List all passkeys for the authenticated user",
|
|
687
|
+
responses: {
|
|
688
|
+
"200": {
|
|
689
|
+
description: "Passkeys retrieved successfully",
|
|
690
|
+
content: {
|
|
691
|
+
"application/json": {
|
|
692
|
+
schema: {
|
|
693
|
+
type: "array",
|
|
694
|
+
items: {
|
|
695
|
+
$ref: "#/components/schemas/Passkey",
|
|
696
|
+
required: [
|
|
697
|
+
"id",
|
|
698
|
+
"userId",
|
|
699
|
+
"publicKey",
|
|
700
|
+
"createdAt",
|
|
701
|
+
"updatedAt"
|
|
702
|
+
]
|
|
703
|
+
},
|
|
704
|
+
description: "Array of passkey objects associated with the user"
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
}
|
|
685
712
|
},
|
|
686
713
|
async (ctx) => {
|
|
687
714
|
const passkeys = await ctx.context.adapter.findMany({
|
|
@@ -700,7 +727,31 @@ const passkey = (options) => {
|
|
|
700
727
|
body: z.object({
|
|
701
728
|
id: z.string()
|
|
702
729
|
}),
|
|
703
|
-
use: [sessionMiddleware]
|
|
730
|
+
use: [sessionMiddleware],
|
|
731
|
+
metadata: {
|
|
732
|
+
openapi: {
|
|
733
|
+
description: "Delete a specific passkey",
|
|
734
|
+
responses: {
|
|
735
|
+
"200": {
|
|
736
|
+
description: "Passkey deleted successfully",
|
|
737
|
+
content: {
|
|
738
|
+
"application/json": {
|
|
739
|
+
schema: {
|
|
740
|
+
type: "object",
|
|
741
|
+
properties: {
|
|
742
|
+
status: {
|
|
743
|
+
type: "boolean",
|
|
744
|
+
description: "Indicates whether the deletion was successful"
|
|
745
|
+
}
|
|
746
|
+
},
|
|
747
|
+
required: ["status"]
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
704
755
|
},
|
|
705
756
|
async (ctx) => {
|
|
706
757
|
await ctx.context.adapter.delete({
|
|
@@ -725,7 +776,30 @@ const passkey = (options) => {
|
|
|
725
776
|
id: z.string(),
|
|
726
777
|
name: z.string()
|
|
727
778
|
}),
|
|
728
|
-
use: [sessionMiddleware]
|
|
779
|
+
use: [sessionMiddleware],
|
|
780
|
+
metadata: {
|
|
781
|
+
openapi: {
|
|
782
|
+
description: "Update a specific passkey's name",
|
|
783
|
+
responses: {
|
|
784
|
+
"200": {
|
|
785
|
+
description: "Passkey updated successfully",
|
|
786
|
+
content: {
|
|
787
|
+
"application/json": {
|
|
788
|
+
schema: {
|
|
789
|
+
type: "object",
|
|
790
|
+
properties: {
|
|
791
|
+
passkey: {
|
|
792
|
+
$ref: "#/components/schemas/Passkey"
|
|
793
|
+
}
|
|
794
|
+
},
|
|
795
|
+
required: ["passkey"]
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
}
|
|
729
803
|
},
|
|
730
804
|
async (ctx) => {
|
|
731
805
|
const passkey2 = await ctx.context.adapter.findOne({
|