better-auth 1.2.0-beta.5 → 1.2.0-beta.6
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 +3 -3
- package/dist/adapters/drizzle.d.cts +1 -1
- package/dist/adapters/drizzle.d.ts +1 -1
- package/dist/adapters/drizzle.js +1 -1
- package/dist/adapters/kysely.cjs +3 -3
- package/dist/adapters/kysely.d.cts +1 -1
- package/dist/adapters/kysely.d.ts +1 -1
- package/dist/adapters/kysely.js +1 -1
- package/dist/adapters/memory.cjs +2 -2
- package/dist/adapters/memory.d.cts +1 -1
- package/dist/adapters/memory.d.ts +1 -1
- package/dist/adapters/memory.js +1 -1
- package/dist/adapters/mongodb.cjs +3 -3
- package/dist/adapters/mongodb.d.cts +1 -1
- package/dist/adapters/mongodb.d.ts +1 -1
- package/dist/adapters/mongodb.js +1 -1
- package/dist/adapters/prisma.cjs +3 -3
- package/dist/adapters/prisma.d.cts +1 -1
- package/dist/adapters/prisma.d.ts +1 -1
- package/dist/adapters/prisma.js +1 -1
- package/dist/adapters/test.d.cts +1 -1
- package/dist/adapters/test.d.ts +1 -1
- package/dist/api.cjs +41 -41
- package/dist/api.d.cts +1 -1
- package/dist/api.d.ts +1 -1
- package/dist/api.js +1 -1
- package/dist/{auth-BIKkqX3w.d.ts → auth-BfbTouIV.d.ts} +5 -5
- package/dist/{auth-DYJ8ix3G.d.cts → auth-CC4kpwks.d.cts} +5 -5
- package/dist/{chunk-7P2P7Y35.js → chunk-2F3IX7O2.js} +1 -1
- package/dist/{chunk-VG5Y5QXC.js → chunk-4KMR5H5T.js} +1 -1
- package/dist/{chunk-XXGFGD3E.js → chunk-52TDJNDX.js} +11 -10
- package/dist/{chunk-YTMPZIP7.js → chunk-5AOJMBJI.js} +25 -3
- package/dist/{chunk-HQFWDJO3.cjs → chunk-5ECP2UE2.cjs} +5 -5
- package/dist/{chunk-VLA6IUW4.js → chunk-5G6XUCMS.js} +51 -2
- package/dist/{chunk-7H42DKFN.cjs → chunk-5KTUVZ3H.cjs} +5 -5
- package/dist/{chunk-QBBUTLKA.cjs → chunk-5RR5WN52.cjs} +5 -5
- package/dist/{chunk-XWK7ZOPU.cjs → chunk-75SPUXMY.cjs} +8 -8
- package/dist/{chunk-5LTLUS6A.js → chunk-BZOIXJ2Q.js} +1 -1
- package/dist/{chunk-SOFKSYNA.js → chunk-CG2CK6HR.js} +1 -1
- package/dist/{chunk-YZFX73MG.cjs → chunk-DURU7ZRA.cjs} +20 -20
- package/dist/{chunk-CLHJAEU2.js → chunk-EQYRCOOF.js} +5 -2
- package/dist/{chunk-IBIVHEIM.js → chunk-FX2ZHENM.js} +1 -1
- package/dist/{chunk-G6W6UQWJ.js → chunk-GWJDRQJ3.js} +2 -2
- package/dist/{chunk-C5LREWPU.cjs → chunk-HUDPJXOF.cjs} +24 -24
- package/dist/{chunk-DSB4P3WF.cjs → chunk-IUGQVFPG.cjs} +6 -6
- package/dist/{chunk-K46S33M5.cjs → chunk-K6WRBJAV.cjs} +3 -3
- package/dist/{chunk-C37NPGBI.cjs → chunk-KAEQXMEV.cjs} +46 -46
- package/dist/{chunk-CV5JTF37.cjs → chunk-KAR56MJZ.cjs} +5 -2
- package/dist/{chunk-6FRITF4C.cjs → chunk-LIGJVOZ4.cjs} +4 -4
- package/dist/{chunk-WKBV4PRW.cjs → chunk-MKNDCNWD.cjs} +3 -3
- package/dist/{chunk-WKXM7XUV.cjs → chunk-N7UWN6ND.cjs} +16 -4
- package/dist/{chunk-TV24P5IW.cjs → chunk-OALLKKNX.cjs} +52 -30
- package/dist/{chunk-3BXU3Z5H.js → chunk-QKCLO6S5.js} +1 -1
- package/dist/{chunk-E3CHTKRP.js → chunk-QLKU77BF.js} +1 -1
- package/dist/{chunk-CYI7H6T2.js → chunk-RMPI2YZ3.js} +1 -1
- package/dist/{chunk-R62AOMGV.js → chunk-SCXZXQTZ.js} +16 -4
- package/dist/{chunk-G365UCY7.js → chunk-ST2CQ4A2.js} +2 -2
- package/dist/{chunk-5RIBF22K.cjs → chunk-U44XLDNH.cjs} +22 -21
- package/dist/{chunk-OLGASOBP.cjs → chunk-UZNKBUDH.cjs} +11 -11
- package/dist/{chunk-7S7YLBK4.js → chunk-V56HFQQX.js} +1 -1
- package/dist/{chunk-HCHSHY7R.cjs → chunk-WD65CNWK.cjs} +77 -28
- package/dist/{chunk-H4A3GCFC.cjs → chunk-XKCN2VRG.cjs} +5 -5
- package/dist/{chunk-QG2HKEKG.js → chunk-XREMX2NV.js} +1 -1
- package/dist/{chunk-MHZNWING.js → chunk-ZDYKAJ67.js} +110 -2
- package/dist/{chunk-6QI5735F.js → chunk-ZKMUJOIP.js} +1 -1
- package/dist/{chunk-LHWLPZ6K.cjs → chunk-ZUUQ3FFY.cjs} +113 -5
- package/dist/client/plugins.d.cts +2 -2
- package/dist/client/plugins.d.ts +2 -2
- package/dist/client.d.cts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/cookies.d.cts +1 -1
- package/dist/cookies.d.ts +1 -1
- package/dist/db.cjs +12 -12
- package/dist/db.d.cts +2 -2
- package/dist/db.d.ts +2 -2
- package/dist/db.js +1 -1
- package/dist/{index-DOB91DVD.d.ts → index-CtbEb8Ls.d.ts} +107 -1
- package/dist/{index-BL6paKGE.d.cts → index-F5NLq5XF.d.cts} +107 -1
- package/dist/index.cjs +11 -11
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- package/dist/next-js.cjs +20 -20
- package/dist/next-js.d.cts +1 -1
- package/dist/next-js.d.ts +1 -1
- package/dist/next-js.js +19 -19
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/oauth2.d.cts +2 -2
- package/dist/oauth2.d.ts +2 -2
- package/dist/plugins/admin.cjs +3 -3
- package/dist/plugins/admin.d.cts +64 -8
- package/dist/plugins/admin.d.ts +64 -8
- package/dist/plugins/admin.js +2 -2
- package/dist/plugins/anonymous.cjs +3 -3
- package/dist/plugins/anonymous.d.cts +1 -1
- package/dist/plugins/anonymous.d.ts +1 -1
- package/dist/plugins/anonymous.js +2 -2
- package/dist/plugins/bearer.cjs +3 -3
- package/dist/plugins/bearer.d.cts +1 -1
- package/dist/plugins/bearer.d.ts +1 -1
- package/dist/plugins/bearer.js +2 -2
- package/dist/plugins/custom-session.cjs +3 -3
- package/dist/plugins/custom-session.d.cts +1 -1
- package/dist/plugins/custom-session.d.ts +1 -1
- package/dist/plugins/custom-session.js +2 -2
- package/dist/plugins/email-otp.cjs +3 -3
- package/dist/plugins/email-otp.d.cts +1 -1
- package/dist/plugins/email-otp.d.ts +1 -1
- package/dist/plugins/email-otp.js +2 -2
- package/dist/plugins/generic-oauth.cjs +3 -3
- package/dist/plugins/generic-oauth.d.cts +74 -1
- package/dist/plugins/generic-oauth.d.ts +74 -1
- package/dist/plugins/generic-oauth.js +2 -2
- package/dist/plugins/jwt.cjs +3 -3
- package/dist/plugins/jwt.d.cts +1 -1
- package/dist/plugins/jwt.d.ts +1 -1
- package/dist/plugins/jwt.js +2 -2
- package/dist/plugins/magic-link.cjs +3 -3
- package/dist/plugins/magic-link.d.cts +4 -0
- package/dist/plugins/magic-link.d.ts +4 -0
- package/dist/plugins/magic-link.js +2 -2
- package/dist/plugins/multi-session.cjs +3 -3
- package/dist/plugins/multi-session.d.cts +1 -1
- package/dist/plugins/multi-session.d.ts +1 -1
- package/dist/plugins/multi-session.js +2 -2
- package/dist/plugins/oidc-provider.cjs +3 -3
- package/dist/plugins/oidc-provider.js +2 -2
- package/dist/plugins/one-tap.cjs +3 -3
- package/dist/plugins/one-tap.js +2 -2
- package/dist/plugins/open-api.cjs +4 -4
- package/dist/plugins/open-api.d.cts +1 -1
- package/dist/plugins/open-api.d.ts +1 -1
- package/dist/plugins/open-api.js +3 -3
- package/dist/plugins/organization.cjs +3 -3
- package/dist/plugins/organization.d.cts +2 -2
- package/dist/plugins/organization.d.ts +2 -2
- package/dist/plugins/organization.js +2 -2
- package/dist/plugins/passkey.cjs +14 -14
- package/dist/plugins/passkey.d.cts +1 -1
- package/dist/plugins/passkey.d.ts +1 -1
- package/dist/plugins/passkey.js +1 -1
- package/dist/plugins/phone-number.cjs +3 -3
- package/dist/plugins/phone-number.d.cts +2 -2
- package/dist/plugins/phone-number.d.ts +2 -2
- package/dist/plugins/phone-number.js +2 -2
- package/dist/plugins/sso.cjs +9 -9
- package/dist/plugins/sso.d.cts +1 -1
- package/dist/plugins/sso.d.ts +1 -1
- package/dist/plugins/sso.js +1 -1
- package/dist/plugins/two-factor.cjs +3 -3
- package/dist/plugins/two-factor.d.cts +1 -1
- package/dist/plugins/two-factor.d.ts +1 -1
- package/dist/plugins/two-factor.js +2 -2
- package/dist/plugins/username.cjs +3 -3
- package/dist/plugins/username.d.cts +1 -1
- package/dist/plugins/username.d.ts +1 -1
- package/dist/plugins/username.js +2 -2
- package/dist/plugins.cjs +39 -39
- package/dist/plugins.d.cts +3 -3
- package/dist/plugins.d.ts +3 -3
- package/dist/plugins.js +19 -19
- package/dist/react.d.cts +2 -3
- package/dist/react.d.ts +2 -3
- package/dist/solid.d.cts +1 -1
- package/dist/solid.d.ts +1 -1
- package/dist/{state-DXzHe8jb.d.ts → state-BlyN0kTT.d.ts} +1 -1
- package/dist/{state-CEqdZ_y_.d.cts → state-ClV1x8my.d.cts} +1 -1
- package/dist/svelte-kit.d.cts +1 -1
- package/dist/svelte-kit.d.ts +1 -1
- package/dist/svelte.d.cts +1 -1
- package/dist/svelte.d.ts +1 -1
- package/dist/types.d.cts +3 -3
- package/dist/types.d.ts +3 -3
- package/dist/vue.d.cts +1 -1
- package/dist/vue.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkKAR56MJZ_cjs = require('../chunk-KAR56MJZ.cjs');
|
|
4
4
|
require('../chunk-B5UCLTPZ.cjs');
|
|
5
5
|
var chunkH74YRRNV_cjs = require('../chunk-H74YRRNV.cjs');
|
|
6
6
|
require('../chunk-2Z6CVQHH.cjs');
|
|
@@ -14,7 +14,7 @@ var chunkPEZRSDZS_cjs = require('../chunk-PEZRSDZS.cjs');
|
|
|
14
14
|
var drizzleOrm = require('drizzle-orm');
|
|
15
15
|
|
|
16
16
|
var createTransform = (db, config, options) => {
|
|
17
|
-
const schema =
|
|
17
|
+
const schema = chunkKAR56MJZ_cjs.getAuthTables(options);
|
|
18
18
|
function getField(model, field) {
|
|
19
19
|
if (field === "id") {
|
|
20
20
|
return field;
|
|
@@ -116,7 +116,7 @@ var createTransform = (db, config, options) => {
|
|
|
116
116
|
if (value === void 0 && !fields[field].defaultValue) {
|
|
117
117
|
continue;
|
|
118
118
|
}
|
|
119
|
-
transformedData[fields[field].fieldName || field] =
|
|
119
|
+
transformedData[fields[field].fieldName || field] = chunkKAR56MJZ_cjs.withApplyDefault(
|
|
120
120
|
value,
|
|
121
121
|
fields[field],
|
|
122
122
|
action
|
package/dist/adapters/drizzle.js
CHANGED
package/dist/adapters/kysely.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkKAR56MJZ_cjs = require('../chunk-KAR56MJZ.cjs');
|
|
4
4
|
require('../chunk-B5UCLTPZ.cjs');
|
|
5
5
|
require('../chunk-H74YRRNV.cjs');
|
|
6
6
|
require('../chunk-2Z6CVQHH.cjs');
|
|
@@ -16,9 +16,9 @@ require('../chunk-PEZRSDZS.cjs');
|
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, "createKyselyAdapter", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkKAR56MJZ_cjs.createKyselyAdapter; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "kyselyAdapter", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkKAR56MJZ_cjs.kyselyAdapter; }
|
|
24
24
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Kysely } from 'kysely';
|
|
2
|
-
import { B as BetterAuthOptions, K as KyselyDatabaseType, W as Where } from '../auth-
|
|
2
|
+
import { B as BetterAuthOptions, K as KyselyDatabaseType, W as Where } from '../auth-CC4kpwks.cjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import 'better-call';
|
|
5
5
|
import '../helper-Bi8FQwDD.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Kysely } from 'kysely';
|
|
2
|
-
import { B as BetterAuthOptions, K as KyselyDatabaseType, W as Where } from '../auth-
|
|
2
|
+
import { B as BetterAuthOptions, K as KyselyDatabaseType, W as Where } from '../auth-BfbTouIV.js';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import 'better-call';
|
|
5
5
|
import '../helper-Bi8FQwDD.js';
|
package/dist/adapters/kysely.js
CHANGED
package/dist/adapters/memory.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkKAR56MJZ_cjs = require('../chunk-KAR56MJZ.cjs');
|
|
4
4
|
require('../chunk-B5UCLTPZ.cjs');
|
|
5
5
|
require('../chunk-H74YRRNV.cjs');
|
|
6
6
|
require('../chunk-2Z6CVQHH.cjs');
|
|
@@ -16,5 +16,5 @@ require('../chunk-PEZRSDZS.cjs');
|
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, "memoryAdapter", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkKAR56MJZ_cjs.memoryAdapter; }
|
|
20
20
|
});
|
package/dist/adapters/memory.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkKAR56MJZ_cjs = require('../chunk-KAR56MJZ.cjs');
|
|
4
4
|
require('../chunk-B5UCLTPZ.cjs');
|
|
5
5
|
require('../chunk-H74YRRNV.cjs');
|
|
6
6
|
require('../chunk-2Z6CVQHH.cjs');
|
|
@@ -14,7 +14,7 @@ require('../chunk-PEZRSDZS.cjs');
|
|
|
14
14
|
var mongodb = require('mongodb');
|
|
15
15
|
|
|
16
16
|
var createTransform = (options) => {
|
|
17
|
-
const schema =
|
|
17
|
+
const schema = chunkKAR56MJZ_cjs.getAuthTables(options);
|
|
18
18
|
function serializeID(field, value, model) {
|
|
19
19
|
if (field === "id" || field === "_id" || schema[model].fields[field].references?.field === "id") {
|
|
20
20
|
if (typeof value !== "string") {
|
|
@@ -81,7 +81,7 @@ var createTransform = (options) => {
|
|
|
81
81
|
if (value === void 0 && (!fields[field].defaultValue || action === "update")) {
|
|
82
82
|
continue;
|
|
83
83
|
}
|
|
84
|
-
transformedData[fields[field].fieldName || field] =
|
|
84
|
+
transformedData[fields[field].fieldName || field] = chunkKAR56MJZ_cjs.withApplyDefault(
|
|
85
85
|
serializeID(field, value, model),
|
|
86
86
|
fields[field],
|
|
87
87
|
action
|
package/dist/adapters/mongodb.js
CHANGED
package/dist/adapters/prisma.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkKAR56MJZ_cjs = require('../chunk-KAR56MJZ.cjs');
|
|
4
4
|
require('../chunk-B5UCLTPZ.cjs');
|
|
5
5
|
var chunkH74YRRNV_cjs = require('../chunk-H74YRRNV.cjs');
|
|
6
6
|
require('../chunk-2Z6CVQHH.cjs');
|
|
@@ -14,7 +14,7 @@ var chunkPEZRSDZS_cjs = require('../chunk-PEZRSDZS.cjs');
|
|
|
14
14
|
|
|
15
15
|
// src/adapters/prisma-adapter/prisma-adapter.ts
|
|
16
16
|
var createTransform = (config, options) => {
|
|
17
|
-
const schema =
|
|
17
|
+
const schema = chunkKAR56MJZ_cjs.getAuthTables(options);
|
|
18
18
|
function getField(model, field) {
|
|
19
19
|
if (field === "id") {
|
|
20
20
|
return field;
|
|
@@ -49,7 +49,7 @@ var createTransform = (config, options) => {
|
|
|
49
49
|
if (value === void 0 && (!fields[field].defaultValue || action === "update")) {
|
|
50
50
|
continue;
|
|
51
51
|
}
|
|
52
|
-
transformedData[fields[field].fieldName || field] =
|
|
52
|
+
transformedData[fields[field].fieldName || field] = chunkKAR56MJZ_cjs.withApplyDefault(
|
|
53
53
|
value,
|
|
54
54
|
fields[field],
|
|
55
55
|
action
|
package/dist/adapters/prisma.js
CHANGED
package/dist/adapters/test.d.cts
CHANGED
package/dist/adapters/test.d.ts
CHANGED
package/dist/api.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkN7UWN6ND_cjs = require('./chunk-N7UWN6ND.cjs');
|
|
4
4
|
require('./chunk-JDAHD767.cjs');
|
|
5
5
|
require('./chunk-SVC7H7K4.cjs');
|
|
6
6
|
require('./chunk-S5UORXJH.cjs');
|
|
@@ -19,161 +19,161 @@ require('./chunk-PEZRSDZS.cjs');
|
|
|
19
19
|
|
|
20
20
|
Object.defineProperty(exports, "APIError", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkN7UWN6ND_cjs.APIError; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "callbackOAuth", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkN7UWN6ND_cjs.callbackOAuth; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "changeEmail", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkN7UWN6ND_cjs.changeEmail; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "changePassword", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkN7UWN6ND_cjs.changePassword; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "createAuthEndpoint", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkN7UWN6ND_cjs.createAuthEndpoint; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "createAuthMiddleware", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkN7UWN6ND_cjs.createAuthMiddleware; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "createEmailVerificationToken", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkN7UWN6ND_cjs.createEmailVerificationToken; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "deleteUser", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkN7UWN6ND_cjs.deleteUser; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "deleteUserCallback", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkN7UWN6ND_cjs.deleteUserCallback; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "error", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunkN7UWN6ND_cjs.error; }
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "forgetPassword", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunkN7UWN6ND_cjs.forgetPassword; }
|
|
63
63
|
});
|
|
64
64
|
Object.defineProperty(exports, "forgetPasswordCallback", {
|
|
65
65
|
enumerable: true,
|
|
66
|
-
get: function () { return
|
|
66
|
+
get: function () { return chunkN7UWN6ND_cjs.forgetPasswordCallback; }
|
|
67
67
|
});
|
|
68
68
|
Object.defineProperty(exports, "freshSessionMiddleware", {
|
|
69
69
|
enumerable: true,
|
|
70
|
-
get: function () { return
|
|
70
|
+
get: function () { return chunkN7UWN6ND_cjs.freshSessionMiddleware; }
|
|
71
71
|
});
|
|
72
72
|
Object.defineProperty(exports, "getEndpoints", {
|
|
73
73
|
enumerable: true,
|
|
74
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunkN7UWN6ND_cjs.getEndpoints; }
|
|
75
75
|
});
|
|
76
76
|
Object.defineProperty(exports, "getSession", {
|
|
77
77
|
enumerable: true,
|
|
78
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunkN7UWN6ND_cjs.getSession; }
|
|
79
79
|
});
|
|
80
80
|
Object.defineProperty(exports, "getSessionFromCtx", {
|
|
81
81
|
enumerable: true,
|
|
82
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunkN7UWN6ND_cjs.getSessionFromCtx; }
|
|
83
83
|
});
|
|
84
84
|
Object.defineProperty(exports, "linkSocialAccount", {
|
|
85
85
|
enumerable: true,
|
|
86
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunkN7UWN6ND_cjs.linkSocialAccount; }
|
|
87
87
|
});
|
|
88
88
|
Object.defineProperty(exports, "listSessions", {
|
|
89
89
|
enumerable: true,
|
|
90
|
-
get: function () { return
|
|
90
|
+
get: function () { return chunkN7UWN6ND_cjs.listSessions; }
|
|
91
91
|
});
|
|
92
92
|
Object.defineProperty(exports, "listUserAccounts", {
|
|
93
93
|
enumerable: true,
|
|
94
|
-
get: function () { return
|
|
94
|
+
get: function () { return chunkN7UWN6ND_cjs.listUserAccounts; }
|
|
95
95
|
});
|
|
96
96
|
Object.defineProperty(exports, "ok", {
|
|
97
97
|
enumerable: true,
|
|
98
|
-
get: function () { return
|
|
98
|
+
get: function () { return chunkN7UWN6ND_cjs.ok; }
|
|
99
99
|
});
|
|
100
100
|
Object.defineProperty(exports, "optionsMiddleware", {
|
|
101
101
|
enumerable: true,
|
|
102
|
-
get: function () { return
|
|
102
|
+
get: function () { return chunkN7UWN6ND_cjs.optionsMiddleware; }
|
|
103
103
|
});
|
|
104
104
|
Object.defineProperty(exports, "originCheck", {
|
|
105
105
|
enumerable: true,
|
|
106
|
-
get: function () { return
|
|
106
|
+
get: function () { return chunkN7UWN6ND_cjs.originCheck; }
|
|
107
107
|
});
|
|
108
108
|
Object.defineProperty(exports, "originCheckMiddleware", {
|
|
109
109
|
enumerable: true,
|
|
110
|
-
get: function () { return
|
|
110
|
+
get: function () { return chunkN7UWN6ND_cjs.originCheckMiddleware; }
|
|
111
111
|
});
|
|
112
112
|
Object.defineProperty(exports, "requestOnlySessionMiddleware", {
|
|
113
113
|
enumerable: true,
|
|
114
|
-
get: function () { return
|
|
114
|
+
get: function () { return chunkN7UWN6ND_cjs.requestOnlySessionMiddleware; }
|
|
115
115
|
});
|
|
116
116
|
Object.defineProperty(exports, "resetPassword", {
|
|
117
117
|
enumerable: true,
|
|
118
|
-
get: function () { return
|
|
118
|
+
get: function () { return chunkN7UWN6ND_cjs.resetPassword; }
|
|
119
119
|
});
|
|
120
120
|
Object.defineProperty(exports, "revokeOtherSessions", {
|
|
121
121
|
enumerable: true,
|
|
122
|
-
get: function () { return
|
|
122
|
+
get: function () { return chunkN7UWN6ND_cjs.revokeOtherSessions; }
|
|
123
123
|
});
|
|
124
124
|
Object.defineProperty(exports, "revokeSession", {
|
|
125
125
|
enumerable: true,
|
|
126
|
-
get: function () { return
|
|
126
|
+
get: function () { return chunkN7UWN6ND_cjs.revokeSession; }
|
|
127
127
|
});
|
|
128
128
|
Object.defineProperty(exports, "revokeSessions", {
|
|
129
129
|
enumerable: true,
|
|
130
|
-
get: function () { return
|
|
130
|
+
get: function () { return chunkN7UWN6ND_cjs.revokeSessions; }
|
|
131
131
|
});
|
|
132
132
|
Object.defineProperty(exports, "router", {
|
|
133
133
|
enumerable: true,
|
|
134
|
-
get: function () { return
|
|
134
|
+
get: function () { return chunkN7UWN6ND_cjs.router; }
|
|
135
135
|
});
|
|
136
136
|
Object.defineProperty(exports, "sendVerificationEmail", {
|
|
137
137
|
enumerable: true,
|
|
138
|
-
get: function () { return
|
|
138
|
+
get: function () { return chunkN7UWN6ND_cjs.sendVerificationEmail; }
|
|
139
139
|
});
|
|
140
140
|
Object.defineProperty(exports, "sendVerificationEmailFn", {
|
|
141
141
|
enumerable: true,
|
|
142
|
-
get: function () { return
|
|
142
|
+
get: function () { return chunkN7UWN6ND_cjs.sendVerificationEmailFn; }
|
|
143
143
|
});
|
|
144
144
|
Object.defineProperty(exports, "sessionMiddleware", {
|
|
145
145
|
enumerable: true,
|
|
146
|
-
get: function () { return
|
|
146
|
+
get: function () { return chunkN7UWN6ND_cjs.sessionMiddleware; }
|
|
147
147
|
});
|
|
148
148
|
Object.defineProperty(exports, "setPassword", {
|
|
149
149
|
enumerable: true,
|
|
150
|
-
get: function () { return
|
|
150
|
+
get: function () { return chunkN7UWN6ND_cjs.setPassword; }
|
|
151
151
|
});
|
|
152
152
|
Object.defineProperty(exports, "signInEmail", {
|
|
153
153
|
enumerable: true,
|
|
154
|
-
get: function () { return
|
|
154
|
+
get: function () { return chunkN7UWN6ND_cjs.signInEmail; }
|
|
155
155
|
});
|
|
156
156
|
Object.defineProperty(exports, "signInSocial", {
|
|
157
157
|
enumerable: true,
|
|
158
|
-
get: function () { return
|
|
158
|
+
get: function () { return chunkN7UWN6ND_cjs.signInSocial; }
|
|
159
159
|
});
|
|
160
160
|
Object.defineProperty(exports, "signOut", {
|
|
161
161
|
enumerable: true,
|
|
162
|
-
get: function () { return
|
|
162
|
+
get: function () { return chunkN7UWN6ND_cjs.signOut; }
|
|
163
163
|
});
|
|
164
164
|
Object.defineProperty(exports, "signUpEmail", {
|
|
165
165
|
enumerable: true,
|
|
166
|
-
get: function () { return
|
|
166
|
+
get: function () { return chunkN7UWN6ND_cjs.signUpEmail; }
|
|
167
167
|
});
|
|
168
168
|
Object.defineProperty(exports, "unlinkAccount", {
|
|
169
169
|
enumerable: true,
|
|
170
|
-
get: function () { return
|
|
170
|
+
get: function () { return chunkN7UWN6ND_cjs.unlinkAccount; }
|
|
171
171
|
});
|
|
172
172
|
Object.defineProperty(exports, "updateUser", {
|
|
173
173
|
enumerable: true,
|
|
174
|
-
get: function () { return
|
|
174
|
+
get: function () { return chunkN7UWN6ND_cjs.updateUser; }
|
|
175
175
|
});
|
|
176
176
|
Object.defineProperty(exports, "verifyEmail", {
|
|
177
177
|
enumerable: true,
|
|
178
|
-
get: function () { return
|
|
178
|
+
get: function () { return chunkN7UWN6ND_cjs.verifyEmail; }
|
|
179
179
|
});
|
package/dist/api.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { h as AuthEndpoint, i as AuthMiddleware, aD as callbackOAuth, a_ as changeEmail, aW as changePassword, g as createAuthEndpoint, f as createAuthMiddleware, aR as createEmailVerificationToken, aY as deleteUser, aZ as deleteUserCallback, a$ as error, aO as forgetPassword, aP as forgetPasswordCallback, aI as freshSessionMiddleware, az as getEndpoints, aE as getSession, aF as getSessionFromCtx, b3 as linkSocialAccount, aJ as listSessions, b2 as listUserAccounts, b0 as ok, o as optionsMiddleware, b6 as originCheck, b5 as originCheckMiddleware, aH as requestOnlySessionMiddleware, aQ as resetPassword, aM as revokeOtherSessions, aK as revokeSession, aL as revokeSessions, aA as router, aT as sendVerificationEmail, aS as sendVerificationEmailFn, aG as sessionMiddleware, aX as setPassword, aC as signInEmail, aB as signInSocial, aN as signOut, b1 as signUpEmail, b4 as unlinkAccount, aV as updateUser, aU as verifyEmail } from './auth-
|
|
1
|
+
export { h as AuthEndpoint, i as AuthMiddleware, aD as callbackOAuth, a_ as changeEmail, aW as changePassword, g as createAuthEndpoint, f as createAuthMiddleware, aR as createEmailVerificationToken, aY as deleteUser, aZ as deleteUserCallback, a$ as error, aO as forgetPassword, aP as forgetPasswordCallback, aI as freshSessionMiddleware, az as getEndpoints, aE as getSession, aF as getSessionFromCtx, b3 as linkSocialAccount, aJ as listSessions, b2 as listUserAccounts, b0 as ok, o as optionsMiddleware, b6 as originCheck, b5 as originCheckMiddleware, aH as requestOnlySessionMiddleware, aQ as resetPassword, aM as revokeOtherSessions, aK as revokeSession, aL as revokeSessions, aA as router, aT as sendVerificationEmail, aS as sendVerificationEmailFn, aG as sessionMiddleware, aX as setPassword, aC as signInEmail, aB as signInSocial, aN as signOut, b1 as signUpEmail, b4 as unlinkAccount, aV as updateUser, aU as verifyEmail } from './auth-CC4kpwks.cjs';
|
|
2
2
|
import './helper-Bi8FQwDD.cjs';
|
|
3
3
|
export { APIError } from 'better-call';
|
|
4
4
|
import 'zod';
|
package/dist/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { h as AuthEndpoint, i as AuthMiddleware, aD as callbackOAuth, a_ as changeEmail, aW as changePassword, g as createAuthEndpoint, f as createAuthMiddleware, aR as createEmailVerificationToken, aY as deleteUser, aZ as deleteUserCallback, a$ as error, aO as forgetPassword, aP as forgetPasswordCallback, aI as freshSessionMiddleware, az as getEndpoints, aE as getSession, aF as getSessionFromCtx, b3 as linkSocialAccount, aJ as listSessions, b2 as listUserAccounts, b0 as ok, o as optionsMiddleware, b6 as originCheck, b5 as originCheckMiddleware, aH as requestOnlySessionMiddleware, aQ as resetPassword, aM as revokeOtherSessions, aK as revokeSession, aL as revokeSessions, aA as router, aT as sendVerificationEmail, aS as sendVerificationEmailFn, aG as sessionMiddleware, aX as setPassword, aC as signInEmail, aB as signInSocial, aN as signOut, b1 as signUpEmail, b4 as unlinkAccount, aV as updateUser, aU as verifyEmail } from './auth-
|
|
1
|
+
export { h as AuthEndpoint, i as AuthMiddleware, aD as callbackOAuth, a_ as changeEmail, aW as changePassword, g as createAuthEndpoint, f as createAuthMiddleware, aR as createEmailVerificationToken, aY as deleteUser, aZ as deleteUserCallback, a$ as error, aO as forgetPassword, aP as forgetPasswordCallback, aI as freshSessionMiddleware, az as getEndpoints, aE as getSession, aF as getSessionFromCtx, b3 as linkSocialAccount, aJ as listSessions, b2 as listUserAccounts, b0 as ok, o as optionsMiddleware, b6 as originCheck, b5 as originCheckMiddleware, aH as requestOnlySessionMiddleware, aQ as resetPassword, aM as revokeOtherSessions, aK as revokeSession, aL as revokeSessions, aA as router, aT as sendVerificationEmail, aS as sendVerificationEmailFn, aG as sessionMiddleware, aX as setPassword, aC as signInEmail, aB as signInSocial, aN as signOut, b1 as signUpEmail, b4 as unlinkAccount, aV as updateUser, aU as verifyEmail } from './auth-BfbTouIV.js';
|
|
2
2
|
import './helper-Bi8FQwDD.js';
|
|
3
3
|
export { APIError } from 'better-call';
|
|
4
4
|
import 'zod';
|
package/dist/api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { APIError, callbackOAuth, changeEmail, changePassword, createAuthEndpoint, createAuthMiddleware, createEmailVerificationToken, deleteUser, deleteUserCallback, error, forgetPassword, forgetPasswordCallback, freshSessionMiddleware, getEndpoints, getSession, getSessionFromCtx, linkSocialAccount, listSessions, listUserAccounts, ok, optionsMiddleware, originCheck, originCheckMiddleware, requestOnlySessionMiddleware, resetPassword, revokeOtherSessions, revokeSession, revokeSessions, router, sendVerificationEmail, sendVerificationEmailFn, sessionMiddleware, setPassword, signInEmail, signInSocial, signOut, signUpEmail, unlinkAccount, updateUser, verifyEmail } from './chunk-
|
|
1
|
+
export { APIError, callbackOAuth, changeEmail, changePassword, createAuthEndpoint, createAuthMiddleware, createEmailVerificationToken, deleteUser, deleteUserCallback, error, forgetPassword, forgetPasswordCallback, freshSessionMiddleware, getEndpoints, getSession, getSessionFromCtx, linkSocialAccount, listSessions, listUserAccounts, ok, optionsMiddleware, originCheck, originCheckMiddleware, requestOnlySessionMiddleware, resetPassword, revokeOtherSessions, revokeSession, revokeSessions, router, sendVerificationEmail, sendVerificationEmailFn, sessionMiddleware, setPassword, signInEmail, signInSocial, signOut, signUpEmail, unlinkAccount, updateUser, verifyEmail } from './chunk-SCXZXQTZ.js';
|
|
2
2
|
import './chunk-TODG5RSV.js';
|
|
3
3
|
import './chunk-R42K7GPF.js';
|
|
4
4
|
import './chunk-XFCIANZX.js';
|
|
@@ -1971,7 +1971,7 @@ type BetterAuthOptions = {
|
|
|
1971
1971
|
/**
|
|
1972
1972
|
* List of trusted origins.
|
|
1973
1973
|
*/
|
|
1974
|
-
trustedOrigins?: string[];
|
|
1974
|
+
trustedOrigins?: string[] | ((request: Request) => string[]);
|
|
1975
1975
|
/**
|
|
1976
1976
|
* Rate limiting configuration
|
|
1977
1977
|
*/
|
|
@@ -2152,7 +2152,7 @@ type BetterAuthOptions = {
|
|
|
2152
2152
|
* If the hook returns an object, it'll be used instead of the original data
|
|
2153
2153
|
*/
|
|
2154
2154
|
before?: (user: User) => Promise<boolean | void | {
|
|
2155
|
-
data: User & Record<string, any>;
|
|
2155
|
+
data: Partial<User> & Record<string, any>;
|
|
2156
2156
|
}>;
|
|
2157
2157
|
/**
|
|
2158
2158
|
* Hook that is called after a user is created.
|
|
@@ -2185,7 +2185,7 @@ type BetterAuthOptions = {
|
|
|
2185
2185
|
* If the hook returns an object, it'll be used instead of the original data
|
|
2186
2186
|
*/
|
|
2187
2187
|
before?: (session: Session) => Promise<boolean | void | {
|
|
2188
|
-
data: Session & Record<string, any>;
|
|
2188
|
+
data: Partial<Session> & Record<string, any>;
|
|
2189
2189
|
}>;
|
|
2190
2190
|
/**
|
|
2191
2191
|
* Hook that is called after a session is updated.
|
|
@@ -2221,7 +2221,7 @@ type BetterAuthOptions = {
|
|
|
2221
2221
|
* If the hook returns an object, it'll be used instead of the original data
|
|
2222
2222
|
*/
|
|
2223
2223
|
before?: (account: Account) => Promise<boolean | void | {
|
|
2224
|
-
data: Account & Record<string, any>;
|
|
2224
|
+
data: Partial<Account> & Record<string, any>;
|
|
2225
2225
|
}>;
|
|
2226
2226
|
/**
|
|
2227
2227
|
* Hook that is called after a account is created.
|
|
@@ -2257,7 +2257,7 @@ type BetterAuthOptions = {
|
|
|
2257
2257
|
* If the hook returns an object, it'll be used instead of the original data
|
|
2258
2258
|
*/
|
|
2259
2259
|
before?: (verification: Verification) => Promise<boolean | void | {
|
|
2260
|
-
data: Verification & Record<string, any>;
|
|
2260
|
+
data: Partial<Verification> & Record<string, any>;
|
|
2261
2261
|
}>;
|
|
2262
2262
|
/**
|
|
2263
2263
|
* Hook that is called after a verification is created.
|
|
@@ -1971,7 +1971,7 @@ type BetterAuthOptions = {
|
|
|
1971
1971
|
/**
|
|
1972
1972
|
* List of trusted origins.
|
|
1973
1973
|
*/
|
|
1974
|
-
trustedOrigins?: string[];
|
|
1974
|
+
trustedOrigins?: string[] | ((request: Request) => string[]);
|
|
1975
1975
|
/**
|
|
1976
1976
|
* Rate limiting configuration
|
|
1977
1977
|
*/
|
|
@@ -2152,7 +2152,7 @@ type BetterAuthOptions = {
|
|
|
2152
2152
|
* If the hook returns an object, it'll be used instead of the original data
|
|
2153
2153
|
*/
|
|
2154
2154
|
before?: (user: User) => Promise<boolean | void | {
|
|
2155
|
-
data: User & Record<string, any>;
|
|
2155
|
+
data: Partial<User> & Record<string, any>;
|
|
2156
2156
|
}>;
|
|
2157
2157
|
/**
|
|
2158
2158
|
* Hook that is called after a user is created.
|
|
@@ -2185,7 +2185,7 @@ type BetterAuthOptions = {
|
|
|
2185
2185
|
* If the hook returns an object, it'll be used instead of the original data
|
|
2186
2186
|
*/
|
|
2187
2187
|
before?: (session: Session) => Promise<boolean | void | {
|
|
2188
|
-
data: Session & Record<string, any>;
|
|
2188
|
+
data: Partial<Session> & Record<string, any>;
|
|
2189
2189
|
}>;
|
|
2190
2190
|
/**
|
|
2191
2191
|
* Hook that is called after a session is updated.
|
|
@@ -2221,7 +2221,7 @@ type BetterAuthOptions = {
|
|
|
2221
2221
|
* If the hook returns an object, it'll be used instead of the original data
|
|
2222
2222
|
*/
|
|
2223
2223
|
before?: (account: Account) => Promise<boolean | void | {
|
|
2224
|
-
data: Account & Record<string, any>;
|
|
2224
|
+
data: Partial<Account> & Record<string, any>;
|
|
2225
2225
|
}>;
|
|
2226
2226
|
/**
|
|
2227
2227
|
* Hook that is called after a account is created.
|
|
@@ -2257,7 +2257,7 @@ type BetterAuthOptions = {
|
|
|
2257
2257
|
* If the hook returns an object, it'll be used instead of the original data
|
|
2258
2258
|
*/
|
|
2259
2259
|
before?: (verification: Verification) => Promise<boolean | void | {
|
|
2260
|
-
data: Verification & Record<string, any>;
|
|
2260
|
+
data: Partial<Verification> & Record<string, any>;
|
|
2261
2261
|
}>;
|
|
2262
2262
|
/**
|
|
2263
2263
|
* Hook that is called after a verification is created.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createAuthEndpoint, sessionMiddleware, createAuthMiddleware } from './chunk-
|
|
1
|
+
import { createAuthEndpoint, sessionMiddleware, createAuthMiddleware } from './chunk-SCXZXQTZ.js';
|
|
2
2
|
import { mergeSchema } from './chunk-HZBNUY7E.js';
|
|
3
3
|
import { symmetricEncrypt, symmetricDecrypt } from './chunk-DBPOZRMS.js';
|
|
4
4
|
import { z } from 'zod';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createAuthEndpoint, BASE_ERROR_CODES, getSessionFromCtx } from './chunk-
|
|
1
|
+
import { createAuthEndpoint, BASE_ERROR_CODES, getSessionFromCtx } from './chunk-SCXZXQTZ.js';
|
|
2
2
|
import { setSessionCookie } from './chunk-QQGZ3XGI.js';
|
|
3
3
|
import { mergeSchema } from './chunk-HZBNUY7E.js';
|
|
4
4
|
import { generateRandomString } from './chunk-DBPOZRMS.js';
|
|
@@ -360,13 +360,6 @@ var phoneNumber = (options) => {
|
|
|
360
360
|
}
|
|
361
361
|
]
|
|
362
362
|
});
|
|
363
|
-
await options?.callbackOnVerification?.(
|
|
364
|
-
{
|
|
365
|
-
phoneNumber: ctx.body.phoneNumber,
|
|
366
|
-
user
|
|
367
|
-
},
|
|
368
|
-
ctx.request
|
|
369
|
-
);
|
|
370
363
|
if (!user) {
|
|
371
364
|
if (options?.signUpOnVerification) {
|
|
372
365
|
user = await ctx.context.internalAdapter.createUser({
|
|
@@ -384,14 +377,22 @@ var phoneNumber = (options) => {
|
|
|
384
377
|
message: BASE_ERROR_CODES.FAILED_TO_CREATE_USER
|
|
385
378
|
});
|
|
386
379
|
}
|
|
387
|
-
} else {
|
|
388
|
-
return ctx.json(null);
|
|
389
380
|
}
|
|
390
381
|
} else {
|
|
391
382
|
user = await ctx.context.internalAdapter.updateUser(user.id, {
|
|
392
383
|
[opts.phoneNumberVerified]: true
|
|
393
384
|
});
|
|
394
385
|
}
|
|
386
|
+
if (!user) {
|
|
387
|
+
return ctx.json(null);
|
|
388
|
+
}
|
|
389
|
+
await options?.callbackOnVerification?.(
|
|
390
|
+
{
|
|
391
|
+
phoneNumber: ctx.body.phoneNumber,
|
|
392
|
+
user
|
|
393
|
+
},
|
|
394
|
+
ctx.request
|
|
395
|
+
);
|
|
395
396
|
if (!user) {
|
|
396
397
|
throw new APIError("INTERNAL_SERVER_ERROR", {
|
|
397
398
|
message: BASE_ERROR_CODES.FAILED_TO_UPDATE_USER
|