better-auth 1.2.4-beta.4 → 1.2.4-beta.5
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/api/index.cjs +1 -1
- package/dist/api/index.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/integrations/next-js.cjs +3 -3
- package/dist/integrations/next-js.mjs +3 -3
- package/dist/plugins/admin/index.cjs +2 -2
- package/dist/plugins/admin/index.mjs +2 -2
- package/dist/plugins/anonymous/index.cjs +1 -1
- package/dist/plugins/anonymous/index.mjs +1 -1
- package/dist/plugins/bearer/index.cjs +1 -1
- package/dist/plugins/bearer/index.mjs +1 -1
- package/dist/plugins/custom-session/index.cjs +1 -1
- package/dist/plugins/custom-session/index.mjs +1 -1
- package/dist/plugins/email-otp/index.cjs +1 -1
- package/dist/plugins/email-otp/index.mjs +1 -1
- package/dist/plugins/generic-oauth/index.cjs +1 -1
- package/dist/plugins/generic-oauth/index.mjs +1 -1
- package/dist/plugins/index.cjs +8 -15
- package/dist/plugins/index.mjs +8 -15
- package/dist/plugins/jwt/index.cjs +6 -2
- package/dist/plugins/jwt/index.mjs +6 -2
- package/dist/plugins/magic-link/index.cjs +1 -1
- package/dist/plugins/magic-link/index.mjs +1 -1
- package/dist/plugins/multi-session/index.cjs +11 -2
- package/dist/plugins/multi-session/index.mjs +11 -2
- package/dist/plugins/oauth-proxy/index.cjs +1 -1
- package/dist/plugins/oauth-proxy/index.mjs +1 -1
- package/dist/plugins/oidc-provider/index.cjs +1 -1
- package/dist/plugins/oidc-provider/index.mjs +1 -1
- package/dist/plugins/one-tap/index.cjs +1 -1
- package/dist/plugins/one-tap/index.mjs +1 -1
- package/dist/plugins/open-api/index.cjs +1 -1
- package/dist/plugins/open-api/index.mjs +1 -1
- package/dist/plugins/organization/index.cjs +3 -3
- package/dist/plugins/organization/index.mjs +3 -3
- package/dist/plugins/passkey/index.cjs +1 -1
- package/dist/plugins/passkey/index.mjs +1 -1
- package/dist/plugins/phone-number/index.cjs +16 -1
- package/dist/plugins/phone-number/index.d.cts +1 -0
- package/dist/plugins/phone-number/index.d.mts +1 -0
- package/dist/plugins/phone-number/index.d.ts +1 -0
- package/dist/plugins/phone-number/index.mjs +16 -1
- package/dist/plugins/sso/index.cjs +1 -1
- package/dist/plugins/sso/index.mjs +1 -1
- package/dist/plugins/two-factor/index.cjs +2 -2
- package/dist/plugins/two-factor/index.mjs +2 -2
- package/dist/plugins/username/index.cjs +1 -1
- package/dist/plugins/username/index.mjs +1 -1
- package/dist/shared/{better-auth.Dy6opOJA.cjs → better-auth.B9EAFFlp.cjs} +1 -1
- package/dist/shared/{better-auth.hdm5MOCK.cjs → better-auth.BTKX27-D.cjs} +2 -2
- package/dist/shared/{better-auth.CsnbeCLi.cjs → better-auth.CbfLzmYA.cjs} +1 -1
- package/dist/shared/{better-auth.KmtpyaoO.mjs → better-auth.CcttI6Ga.mjs} +1 -1
- package/dist/shared/{better-auth.pf5SQkJM.mjs → better-auth.CfIIIkAv.mjs} +1 -1
- package/dist/shared/{better-auth.B_LJ7ih7.cjs → better-auth.D60yW05g.cjs} +10 -13
- package/dist/shared/{better-auth.Cju5zdPQ.cjs → better-auth.DWy7mPjr.cjs} +1 -1
- package/dist/shared/{better-auth.jsVM_L7s.mjs → better-auth.Dxynqa8m.mjs} +10 -13
- package/dist/shared/{better-auth.mLf3tSlS.mjs → better-auth.vVUb_2f5.mjs} +1 -1
- package/dist/shared/{better-auth.DBGQd-c3.mjs → better-auth.x7nh5kI2.mjs} +2 -2
- package/dist/social-providers/index.cjs +3 -1
- package/dist/social-providers/index.mjs +3 -1
- package/package.json +1 -1
package/dist/api/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const betterCall = require('better-call');
|
|
4
|
-
const account = require('../shared/better-auth.
|
|
4
|
+
const account = require('../shared/better-auth.D60yW05g.cjs');
|
|
5
5
|
const zod = require('zod');
|
|
6
6
|
const cookies_index = require('../cookies/index.cjs');
|
|
7
7
|
const schema = require('../shared/better-auth.CHyZMcYK.cjs');
|
package/dist/api/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { APIError, toResponse, createRouter } from 'better-call';
|
|
2
2
|
export { APIError } from 'better-call';
|
|
3
|
-
import { a as createAuthEndpoint, B as BASE_ERROR_CODES, d as createEmailVerificationToken, w as wildcardMatch, l as listSessions, u as updateUser, e as getSession, i as originCheckMiddleware, j as error, k as ok, m as unlinkAccount, n as deleteUserCallback, p as listUserAccounts, q as linkSocialAccount, r as revokeOtherSessions, t as revokeSessions, v as revokeSession, x as forgetPasswordCallback, y as deleteUser, z as setPassword, A as changePassword, C as changeEmail, D as sendVerificationEmail, E as verifyEmail, F as resetPassword, G as forgetPassword, I as signInEmail, J as signOut, K as callbackOAuth, L as signInSocial } from '../shared/better-auth.
|
|
4
|
-
export { c as createAuthMiddleware, f as freshSessionMiddleware, g as getSessionFromCtx, N as optionsMiddleware, o as originCheck, M as requestOnlySessionMiddleware, b as sendVerificationEmailFn, s as sessionMiddleware } from '../shared/better-auth.
|
|
3
|
+
import { a as createAuthEndpoint, B as BASE_ERROR_CODES, d as createEmailVerificationToken, w as wildcardMatch, l as listSessions, u as updateUser, e as getSession, i as originCheckMiddleware, j as error, k as ok, m as unlinkAccount, n as deleteUserCallback, p as listUserAccounts, q as linkSocialAccount, r as revokeOtherSessions, t as revokeSessions, v as revokeSession, x as forgetPasswordCallback, y as deleteUser, z as setPassword, A as changePassword, C as changeEmail, D as sendVerificationEmail, E as verifyEmail, F as resetPassword, G as forgetPassword, I as signInEmail, J as signOut, K as callbackOAuth, L as signInSocial } from '../shared/better-auth.Dxynqa8m.mjs';
|
|
4
|
+
export { c as createAuthMiddleware, f as freshSessionMiddleware, g as getSessionFromCtx, N as optionsMiddleware, o as originCheck, M as requestOnlySessionMiddleware, b as sendVerificationEmailFn, s as sessionMiddleware } from '../shared/better-auth.Dxynqa8m.mjs';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { setSessionCookie } from '../cookies/index.mjs';
|
|
7
7
|
import { f as parseUserInput } from '../shared/better-auth.C24Bzw4w.mjs';
|
package/dist/index.cjs
CHANGED
|
@@ -23,7 +23,7 @@ const env = require('./shared/better-auth.DiSjtgs9.cjs');
|
|
|
23
23
|
const password$1 = require('./shared/better-auth.CDXNofOe.cjs');
|
|
24
24
|
const url = require('./shared/better-auth.DhfiEsxl.cjs');
|
|
25
25
|
const index = require('./shared/better-auth.ANpbi45u.cjs');
|
|
26
|
-
const account = require('./shared/better-auth.
|
|
26
|
+
const account = require('./shared/better-auth.D60yW05g.cjs');
|
|
27
27
|
const misc = require('./shared/better-auth.BLDOwz3i.cjs');
|
|
28
28
|
const state = require('./shared/better-auth.GgQnT00n.cjs');
|
|
29
29
|
require('./shared/better-auth.BgkOX1Ei.cjs');
|
package/dist/index.mjs
CHANGED
|
@@ -23,8 +23,8 @@ import { c as checkPassword } from './shared/better-auth.YwDQhoPc.mjs';
|
|
|
23
23
|
import { a as getBaseURL } from './shared/better-auth.NcLhHEks.mjs';
|
|
24
24
|
import { B as BetterAuthError } from './shared/better-auth.DdzSJf-n.mjs';
|
|
25
25
|
export { M as MissingDependencyError } from './shared/better-auth.DdzSJf-n.mjs';
|
|
26
|
-
import { B as BASE_ERROR_CODES } from './shared/better-auth.
|
|
27
|
-
export { H as HIDE_METADATA } from './shared/better-auth.
|
|
26
|
+
import { B as BASE_ERROR_CODES } from './shared/better-auth.Dxynqa8m.mjs';
|
|
27
|
+
export { H as HIDE_METADATA } from './shared/better-auth.Dxynqa8m.mjs';
|
|
28
28
|
export { c as capitalizeFirstLetter } from './shared/better-auth.D-2CmEwz.mjs';
|
|
29
29
|
export { g as generateState, p as parseState } from './shared/better-auth.CoMXyQ1y.mjs';
|
|
30
30
|
import './shared/better-auth.Duk7IG0N.mjs';
|
|
@@ -6,9 +6,9 @@ require('@better-auth/utils/hmac');
|
|
|
6
6
|
const cookies_index = require('../cookies/index.cjs');
|
|
7
7
|
require('better-call');
|
|
8
8
|
require('zod');
|
|
9
|
-
const account = require('../shared/better-auth.
|
|
9
|
+
const account = require('../shared/better-auth.D60yW05g.cjs');
|
|
10
10
|
require('../shared/better-auth.CHyZMcYK.cjs');
|
|
11
|
-
require('../shared/better-auth.
|
|
11
|
+
require('../shared/better-auth.CbfLzmYA.cjs');
|
|
12
12
|
require('../plugins/organization/access/index.cjs');
|
|
13
13
|
require('../shared/better-auth.CYeOI8C-.cjs');
|
|
14
14
|
require('../shared/better-auth.GpOOav9x.cjs');
|
|
@@ -22,7 +22,7 @@ require('@noble/hashes/scrypt');
|
|
|
22
22
|
require('@better-auth/utils');
|
|
23
23
|
require('@better-auth/utils/hex');
|
|
24
24
|
require('@noble/hashes/utils');
|
|
25
|
-
require('../shared/better-auth.
|
|
25
|
+
require('../shared/better-auth.DWy7mPjr.cjs');
|
|
26
26
|
require('@better-auth/utils/otp');
|
|
27
27
|
require('../plugins/admin/access/index.cjs');
|
|
28
28
|
require('@better-fetch/fetch');
|
|
@@ -4,9 +4,9 @@ import '@better-auth/utils/hmac';
|
|
|
4
4
|
import { parseSetCookieHeader } from '../cookies/index.mjs';
|
|
5
5
|
import 'better-call';
|
|
6
6
|
import 'zod';
|
|
7
|
-
import { c as createAuthMiddleware } from '../shared/better-auth.
|
|
7
|
+
import { c as createAuthMiddleware } from '../shared/better-auth.Dxynqa8m.mjs';
|
|
8
8
|
import '../shared/better-auth.C24Bzw4w.mjs';
|
|
9
|
-
import '../shared/better-auth.
|
|
9
|
+
import '../shared/better-auth.CcttI6Ga.mjs';
|
|
10
10
|
import '../plugins/organization/access/index.mjs';
|
|
11
11
|
import '../shared/better-auth.B4Qoxdgc.mjs';
|
|
12
12
|
import '../shared/better-auth.DH3YjMQH.mjs';
|
|
@@ -20,7 +20,7 @@ import '@noble/hashes/scrypt';
|
|
|
20
20
|
import '@better-auth/utils';
|
|
21
21
|
import '@better-auth/utils/hex';
|
|
22
22
|
import '@noble/hashes/utils';
|
|
23
|
-
import '../shared/better-auth.
|
|
23
|
+
import '../shared/better-auth.vVUb_2f5.mjs';
|
|
24
24
|
import '@better-auth/utils/otp';
|
|
25
25
|
import '../plugins/admin/access/index.mjs';
|
|
26
26
|
import '@better-fetch/fetch';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const admin = require('../../shared/better-auth.
|
|
3
|
+
const admin = require('../../shared/better-auth.B9EAFFlp.cjs');
|
|
4
4
|
require('zod');
|
|
5
5
|
require('better-call');
|
|
6
|
-
require('../../shared/better-auth.
|
|
6
|
+
require('../../shared/better-auth.D60yW05g.cjs');
|
|
7
7
|
require('../../cookies/index.cjs');
|
|
8
8
|
require('../../shared/better-auth.ANpbi45u.cjs');
|
|
9
9
|
require('../../shared/better-auth.C1hdVENX.cjs');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { a as admin } from '../../shared/better-auth.
|
|
1
|
+
export { a as admin } from '../../shared/better-auth.CfIIIkAv.mjs';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import 'better-call';
|
|
4
|
-
import '../../shared/better-auth.
|
|
4
|
+
import '../../shared/better-auth.Dxynqa8m.mjs';
|
|
5
5
|
import '../../cookies/index.mjs';
|
|
6
6
|
import '../../shared/better-auth.DdzSJf-n.mjs';
|
|
7
7
|
import '../../shared/better-auth.CW6D9eSx.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const betterCall = require('better-call');
|
|
4
|
-
const account = require('../../shared/better-auth.
|
|
4
|
+
const account = require('../../shared/better-auth.D60yW05g.cjs');
|
|
5
5
|
require('zod');
|
|
6
6
|
const cookies_index = require('../../cookies/index.cjs');
|
|
7
7
|
const schema$1 = require('../../shared/better-auth.CHyZMcYK.cjs');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { APIError } from 'better-call';
|
|
2
|
-
import { c as createAuthMiddleware, a as createAuthEndpoint, g as getSessionFromCtx } from '../../shared/better-auth.
|
|
2
|
+
import { c as createAuthMiddleware, a as createAuthEndpoint, g as getSessionFromCtx } from '../../shared/better-auth.Dxynqa8m.mjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import { parseSetCookieHeader, setSessionCookie } from '../../cookies/index.mjs';
|
|
5
5
|
import { m as mergeSchema } from '../../shared/better-auth.C24Bzw4w.mjs';
|
|
@@ -5,7 +5,7 @@ require('../../shared/better-auth.DiSjtgs9.cjs');
|
|
|
5
5
|
require('@better-auth/utils/base64');
|
|
6
6
|
const hmac = require('@better-auth/utils/hmac');
|
|
7
7
|
const cookies_index = require('../../cookies/index.cjs');
|
|
8
|
-
const account = require('../../shared/better-auth.
|
|
8
|
+
const account = require('../../shared/better-auth.D60yW05g.cjs');
|
|
9
9
|
require('zod');
|
|
10
10
|
require('../../shared/better-auth.CHyZMcYK.cjs');
|
|
11
11
|
require('../../shared/better-auth.GpOOav9x.cjs');
|
|
@@ -3,7 +3,7 @@ import '../../shared/better-auth.8zoxzg-F.mjs';
|
|
|
3
3
|
import '@better-auth/utils/base64';
|
|
4
4
|
import { createHMAC } from '@better-auth/utils/hmac';
|
|
5
5
|
import { parseSetCookieHeader } from '../../cookies/index.mjs';
|
|
6
|
-
import { c as createAuthMiddleware } from '../../shared/better-auth.
|
|
6
|
+
import { c as createAuthMiddleware } from '../../shared/better-auth.Dxynqa8m.mjs';
|
|
7
7
|
import 'zod';
|
|
8
8
|
import '../../shared/better-auth.C24Bzw4w.mjs';
|
|
9
9
|
import '../../shared/better-auth.DH3YjMQH.mjs';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const zod = require('zod');
|
|
4
4
|
require('better-call');
|
|
5
|
-
const account = require('../../shared/better-auth.
|
|
5
|
+
const account = require('../../shared/better-auth.D60yW05g.cjs');
|
|
6
6
|
require('../../shared/better-auth.DiSjtgs9.cjs');
|
|
7
7
|
require('@better-auth/utils/base64');
|
|
8
8
|
require('@better-auth/utils/hmac');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import 'better-call';
|
|
3
|
-
import { a as createAuthEndpoint, g as getSessionFromCtx } from '../../shared/better-auth.
|
|
3
|
+
import { a as createAuthEndpoint, g as getSessionFromCtx } from '../../shared/better-auth.Dxynqa8m.mjs';
|
|
4
4
|
import '../../shared/better-auth.8zoxzg-F.mjs';
|
|
5
5
|
import '@better-auth/utils/base64';
|
|
6
6
|
import '@better-auth/utils/hmac';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const zod = require('zod');
|
|
4
4
|
const betterCall = require('better-call');
|
|
5
|
-
const account = require('../../shared/better-auth.
|
|
5
|
+
const account = require('../../shared/better-auth.D60yW05g.cjs');
|
|
6
6
|
const cookies_index = require('../../cookies/index.cjs');
|
|
7
7
|
require('../../shared/better-auth.CHyZMcYK.cjs');
|
|
8
8
|
require('../../shared/better-auth.DiSjtgs9.cjs');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { APIError } from 'better-call';
|
|
3
|
-
import { c as createAuthMiddleware, a as createAuthEndpoint } from '../../shared/better-auth.
|
|
3
|
+
import { c as createAuthMiddleware, a as createAuthEndpoint } from '../../shared/better-auth.Dxynqa8m.mjs';
|
|
4
4
|
import { setSessionCookie } from '../../cookies/index.mjs';
|
|
5
5
|
import '../../shared/better-auth.C24Bzw4w.mjs';
|
|
6
6
|
import '../../shared/better-auth.8zoxzg-F.mjs';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const fetch = require('@better-fetch/fetch');
|
|
4
4
|
const betterCall = require('better-call');
|
|
5
5
|
const zod = require('zod');
|
|
6
|
-
const account = require('../../shared/better-auth.
|
|
6
|
+
const account = require('../../shared/better-auth.D60yW05g.cjs');
|
|
7
7
|
const cookies_index = require('../../cookies/index.cjs');
|
|
8
8
|
require('../../shared/better-auth.CHyZMcYK.cjs');
|
|
9
9
|
require('../../shared/better-auth.DiSjtgs9.cjs');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { betterFetch } from '@better-fetch/fetch';
|
|
2
2
|
import { APIError } from 'better-call';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { a as createAuthEndpoint, s as sessionMiddleware, B as BASE_ERROR_CODES, h as handleOAuthUserInfo } from '../../shared/better-auth.
|
|
4
|
+
import { a as createAuthEndpoint, s as sessionMiddleware, B as BASE_ERROR_CODES, h as handleOAuthUserInfo } from '../../shared/better-auth.Dxynqa8m.mjs';
|
|
5
5
|
import { setSessionCookie } from '../../cookies/index.mjs';
|
|
6
6
|
import '../../shared/better-auth.C24Bzw4w.mjs';
|
|
7
7
|
import '../../shared/better-auth.8zoxzg-F.mjs';
|
package/dist/plugins/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const organization = require('../shared/better-auth.
|
|
3
|
+
const organization = require('../shared/better-auth.BTKX27-D.cjs');
|
|
4
4
|
const plugins_twoFactor_index = require('./two-factor/index.cjs');
|
|
5
5
|
const plugins_username_index = require('./username/index.cjs');
|
|
6
6
|
const plugins_bearer_index = require('./bearer/index.cjs');
|
|
7
|
-
const account = require('../shared/better-auth.
|
|
7
|
+
const account = require('../shared/better-auth.D60yW05g.cjs');
|
|
8
8
|
const plugins_magicLink_index = require('./magic-link/index.cjs');
|
|
9
9
|
const plugins_phoneNumber_index = require('./phone-number/index.cjs');
|
|
10
10
|
const plugins_anonymous_index = require('./anonymous/index.cjs');
|
|
11
|
-
const admin = require('../shared/better-auth.
|
|
11
|
+
const admin = require('../shared/better-auth.B9EAFFlp.cjs');
|
|
12
12
|
const plugins_genericOauth_index = require('./generic-oauth/index.cjs');
|
|
13
13
|
const plugins_jwt_index = require('./jwt/index.cjs');
|
|
14
14
|
const plugins_multiSession_index = require('./multi-session/index.cjs');
|
|
@@ -46,14 +46,14 @@ const json = require('../shared/better-auth.D3mtHEZg.cjs');
|
|
|
46
46
|
const id = require('../shared/better-auth.Bg6iw3ig.cjs');
|
|
47
47
|
const plugins_access_index = require('./access/index.cjs');
|
|
48
48
|
const client = require('../shared/better-auth.DnER2-iT.cjs');
|
|
49
|
-
require('../shared/better-auth.
|
|
49
|
+
require('../shared/better-auth.CbfLzmYA.cjs');
|
|
50
50
|
require('../cookies/index.cjs');
|
|
51
51
|
require('../shared/better-auth.ANpbi45u.cjs');
|
|
52
52
|
require('./organization/access/index.cjs');
|
|
53
53
|
require('../crypto/index.cjs');
|
|
54
54
|
require('../shared/better-auth.YUF6P-PB.cjs');
|
|
55
55
|
require('../shared/better-auth.BMYo0QR-.cjs');
|
|
56
|
-
require('../shared/better-auth.
|
|
56
|
+
require('../shared/better-auth.DWy7mPjr.cjs');
|
|
57
57
|
require('../shared/better-auth.C1-vpKly.cjs');
|
|
58
58
|
require('@better-auth/utils/otp');
|
|
59
59
|
require('../shared/better-auth.CDXNofOe.cjs');
|
|
@@ -264,7 +264,7 @@ const apiKeySchema = ({
|
|
|
264
264
|
function createApiKey({
|
|
265
265
|
keyGenerator,
|
|
266
266
|
opts,
|
|
267
|
-
schema
|
|
267
|
+
schema,
|
|
268
268
|
deleteAllExpiredApiKeys
|
|
269
269
|
}) {
|
|
270
270
|
return account.createAuthEndpoint(
|
|
@@ -438,17 +438,10 @@ function createApiKey({
|
|
|
438
438
|
permissions: permissionsToApply
|
|
439
439
|
};
|
|
440
440
|
if (metadata) {
|
|
441
|
-
|
|
442
|
-
data,
|
|
443
|
-
apiKeySchema({
|
|
444
|
-
rateLimitMax: opts.rateLimit.maxRequests,
|
|
445
|
-
timeWindow: opts.rateLimit.timeWindow
|
|
446
|
-
}).apikey
|
|
447
|
-
);
|
|
448
|
-
data.metadata = parseMetadata.metadata ?? null;
|
|
441
|
+
data.metadata = schema.apikey.fields.metadata.transform.input(metadata);
|
|
449
442
|
}
|
|
450
443
|
const apiKey = await ctx.context.adapter.create({
|
|
451
|
-
model: schema
|
|
444
|
+
model: schema.apikey.modelName,
|
|
452
445
|
data
|
|
453
446
|
});
|
|
454
447
|
return ctx.json({
|
package/dist/plugins/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { o as organization } from '../shared/better-auth.
|
|
1
|
+
export { o as organization } from '../shared/better-auth.x7nh5kI2.mjs';
|
|
2
2
|
export { twoFactor } from './two-factor/index.mjs';
|
|
3
3
|
export { username } from './username/index.mjs';
|
|
4
4
|
export { bearer } from './bearer/index.mjs';
|
|
5
|
-
import { a as createAuthEndpoint, g as getSessionFromCtx, s as sessionMiddleware, c as createAuthMiddleware } from '../shared/better-auth.
|
|
6
|
-
export { H as HIDE_METADATA, N as optionsMiddleware } from '../shared/better-auth.
|
|
5
|
+
import { a as createAuthEndpoint, g as getSessionFromCtx, s as sessionMiddleware, c as createAuthMiddleware } from '../shared/better-auth.Dxynqa8m.mjs';
|
|
6
|
+
export { H as HIDE_METADATA, N as optionsMiddleware } from '../shared/better-auth.Dxynqa8m.mjs';
|
|
7
7
|
export { magicLink } from './magic-link/index.mjs';
|
|
8
8
|
export { phoneNumber } from './phone-number/index.mjs';
|
|
9
9
|
export { anonymous } from './anonymous/index.mjs';
|
|
10
|
-
export { a as admin } from '../shared/better-auth.
|
|
10
|
+
export { a as admin } from '../shared/better-auth.CfIIIkAv.mjs';
|
|
11
11
|
export { genericOAuth } from './generic-oauth/index.mjs';
|
|
12
12
|
export { getJwtToken, jwt } from './jwt/index.mjs';
|
|
13
13
|
export { multiSession } from './multi-session/index.mjs';
|
|
@@ -25,7 +25,7 @@ import { z } from 'zod';
|
|
|
25
25
|
import { g as getDate } from '../shared/better-auth.CW6D9eSx.mjs';
|
|
26
26
|
import '../shared/better-auth.8zoxzg-F.mjs';
|
|
27
27
|
import '@better-auth/utils/hmac';
|
|
28
|
-
import {
|
|
28
|
+
import { m as mergeSchema } from '../shared/better-auth.C24Bzw4w.mjs';
|
|
29
29
|
import '../shared/better-auth.DH3YjMQH.mjs';
|
|
30
30
|
import { g as getIp } from '../shared/better-auth.Duk7IG0N.mjs';
|
|
31
31
|
import 'defu';
|
|
@@ -45,14 +45,14 @@ import { s as safeJSONParse } from '../shared/better-auth.tB5eU6EY.mjs';
|
|
|
45
45
|
import { g as generateId } from '../shared/better-auth.BUPPRXfK.mjs';
|
|
46
46
|
import { role } from './access/index.mjs';
|
|
47
47
|
export { t as twoFactorClient } from '../shared/better-auth.Ddw8bVyV.mjs';
|
|
48
|
-
import '../shared/better-auth.
|
|
48
|
+
import '../shared/better-auth.CcttI6Ga.mjs';
|
|
49
49
|
import '../cookies/index.mjs';
|
|
50
50
|
import '../shared/better-auth.DdzSJf-n.mjs';
|
|
51
51
|
import './organization/access/index.mjs';
|
|
52
52
|
import '../crypto/index.mjs';
|
|
53
53
|
import '../shared/better-auth.OT3XFeFk.mjs';
|
|
54
54
|
import '../shared/better-auth.DDEbWX-S.mjs';
|
|
55
|
-
import '../shared/better-auth.
|
|
55
|
+
import '../shared/better-auth.vVUb_2f5.mjs';
|
|
56
56
|
import '../shared/better-auth.BcoSd9tC.mjs';
|
|
57
57
|
import '@better-auth/utils/otp';
|
|
58
58
|
import '../shared/better-auth.YwDQhoPc.mjs';
|
|
@@ -437,14 +437,7 @@ function createApiKey({
|
|
|
437
437
|
permissions: permissionsToApply
|
|
438
438
|
};
|
|
439
439
|
if (metadata) {
|
|
440
|
-
|
|
441
|
-
data,
|
|
442
|
-
apiKeySchema({
|
|
443
|
-
rateLimitMax: opts.rateLimit.maxRequests,
|
|
444
|
-
timeWindow: opts.rateLimit.timeWindow
|
|
445
|
-
}).apikey
|
|
446
|
-
);
|
|
447
|
-
data.metadata = parseMetadata.metadata ?? null;
|
|
440
|
+
data.metadata = schema.apikey.fields.metadata.transform.input(metadata);
|
|
448
441
|
}
|
|
449
442
|
const apiKey = await ctx.context.adapter.create({
|
|
450
443
|
model: schema.apikey.modelName,
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
const schema$1 = require('../../shared/better-auth.BG6vHVNT.cjs');
|
|
4
4
|
const jose = require('jose');
|
|
5
5
|
require('better-call');
|
|
6
|
-
const account = require('../../shared/better-auth.
|
|
6
|
+
const account = require('../../shared/better-auth.D60yW05g.cjs');
|
|
7
7
|
require('zod');
|
|
8
|
+
const index = require('../../shared/better-auth.ANpbi45u.cjs');
|
|
8
9
|
require('../../shared/better-auth.DiSjtgs9.cjs');
|
|
9
10
|
require('@better-auth/utils/base64');
|
|
10
11
|
require('@better-auth/utils/hmac');
|
|
@@ -13,7 +14,6 @@ require('../../shared/better-auth.GpOOav9x.cjs');
|
|
|
13
14
|
require('defu');
|
|
14
15
|
const crypto_index = require('../../crypto/index.cjs');
|
|
15
16
|
require('../../cookies/index.cjs');
|
|
16
|
-
require('../../shared/better-auth.ANpbi45u.cjs');
|
|
17
17
|
require('../../shared/better-auth.C1hdVENX.cjs');
|
|
18
18
|
require('../../shared/better-auth.D3mtHEZg.cjs');
|
|
19
19
|
require('../../social-providers/index.cjs');
|
|
@@ -101,6 +101,10 @@ async function getJwtToken(ctx, options) {
|
|
|
101
101
|
let privateWebKey = privateKeyEncryptionEnabled ? await crypto_index.symmetricDecrypt({
|
|
102
102
|
key: ctx.context.secret,
|
|
103
103
|
data: JSON.parse(key.privateKey)
|
|
104
|
+
}).catch(() => {
|
|
105
|
+
throw new index.BetterAuthError(
|
|
106
|
+
"Failed to decrypt private private key. Make sure the secret currently in use is the same as the one used to encrypt the private key. If you are using a different secret, either cleanup your jwks or disable private key encryption."
|
|
107
|
+
);
|
|
104
108
|
}) : key.privateKey;
|
|
105
109
|
const privateKey = await jose.importJWK(
|
|
106
110
|
JSON.parse(privateWebKey),
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { s as schema } from '../../shared/better-auth.fsvwNeUx.mjs';
|
|
2
2
|
import { generateKeyPair, exportJWK, importJWK, SignJWT } from 'jose';
|
|
3
3
|
import 'better-call';
|
|
4
|
-
import { c as createAuthMiddleware, a as createAuthEndpoint, s as sessionMiddleware } from '../../shared/better-auth.
|
|
4
|
+
import { c as createAuthMiddleware, a as createAuthEndpoint, s as sessionMiddleware } from '../../shared/better-auth.Dxynqa8m.mjs';
|
|
5
5
|
import 'zod';
|
|
6
|
+
import { B as BetterAuthError } from '../../shared/better-auth.DdzSJf-n.mjs';
|
|
6
7
|
import '../../shared/better-auth.8zoxzg-F.mjs';
|
|
7
8
|
import '@better-auth/utils/base64';
|
|
8
9
|
import '@better-auth/utils/hmac';
|
|
@@ -11,7 +12,6 @@ import '../../shared/better-auth.DH3YjMQH.mjs';
|
|
|
11
12
|
import 'defu';
|
|
12
13
|
import { symmetricEncrypt, symmetricDecrypt } from '../../crypto/index.mjs';
|
|
13
14
|
import '../../cookies/index.mjs';
|
|
14
|
-
import '../../shared/better-auth.DdzSJf-n.mjs';
|
|
15
15
|
import '../../shared/better-auth.CW6D9eSx.mjs';
|
|
16
16
|
import '../../shared/better-auth.tB5eU6EY.mjs';
|
|
17
17
|
import '../../social-providers/index.mjs';
|
|
@@ -99,6 +99,10 @@ async function getJwtToken(ctx, options) {
|
|
|
99
99
|
let privateWebKey = privateKeyEncryptionEnabled ? await symmetricDecrypt({
|
|
100
100
|
key: ctx.context.secret,
|
|
101
101
|
data: JSON.parse(key.privateKey)
|
|
102
|
+
}).catch(() => {
|
|
103
|
+
throw new BetterAuthError(
|
|
104
|
+
"Failed to decrypt private private key. Make sure the secret currently in use is the same as the one used to encrypt the private key. If you are using a different secret, either cleanup your jwks or disable private key encryption."
|
|
105
|
+
);
|
|
102
106
|
}) : key.privateKey;
|
|
103
107
|
const privateKey = await importJWK(
|
|
104
108
|
JSON.parse(privateWebKey),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zod = require('zod');
|
|
4
|
-
const account = require('../../shared/better-auth.
|
|
4
|
+
const account = require('../../shared/better-auth.D60yW05g.cjs');
|
|
5
5
|
const betterCall = require('better-call');
|
|
6
6
|
const cookies_index = require('../../cookies/index.cjs');
|
|
7
7
|
require('@better-auth/utils/hash');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { a as createAuthEndpoint, o as originCheck, B as BASE_ERROR_CODES } from '../../shared/better-auth.
|
|
2
|
+
import { a as createAuthEndpoint, o as originCheck, B as BASE_ERROR_CODES } from '../../shared/better-auth.Dxynqa8m.mjs';
|
|
3
3
|
import { APIError } from 'better-call';
|
|
4
4
|
import { setSessionCookie } from '../../cookies/index.mjs';
|
|
5
5
|
import '@better-auth/utils/hash';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const zod = require('zod');
|
|
4
4
|
const betterCall = require('better-call');
|
|
5
|
-
const account = require('../../shared/better-auth.
|
|
5
|
+
const account = require('../../shared/better-auth.D60yW05g.cjs');
|
|
6
6
|
const cookies_index = require('../../cookies/index.cjs');
|
|
7
7
|
require('../../shared/better-auth.CHyZMcYK.cjs');
|
|
8
8
|
require('../../shared/better-auth.DiSjtgs9.cjs');
|
|
@@ -66,7 +66,16 @@ const multiSession = (options) => {
|
|
|
66
66
|
const validSessions = sessions.filter(
|
|
67
67
|
(session) => session && session.session.expiresAt > /* @__PURE__ */ new Date()
|
|
68
68
|
);
|
|
69
|
-
|
|
69
|
+
const uniqueUserSessions = validSessions.reduce(
|
|
70
|
+
(acc, session) => {
|
|
71
|
+
if (!acc.find((s) => s.user.id === session.user.id)) {
|
|
72
|
+
acc.push(session);
|
|
73
|
+
}
|
|
74
|
+
return acc;
|
|
75
|
+
},
|
|
76
|
+
[]
|
|
77
|
+
);
|
|
78
|
+
return ctx.json(uniqueUserSessions);
|
|
70
79
|
}
|
|
71
80
|
),
|
|
72
81
|
setActiveSession: account.createAuthEndpoint(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { APIError } from 'better-call';
|
|
3
|
-
import { c as createAuthMiddleware, a as createAuthEndpoint, s as sessionMiddleware } from '../../shared/better-auth.
|
|
3
|
+
import { c as createAuthMiddleware, a as createAuthEndpoint, s as sessionMiddleware } from '../../shared/better-auth.Dxynqa8m.mjs';
|
|
4
4
|
import { parseSetCookieHeader, parseCookies, setSessionCookie, deleteSessionCookie } from '../../cookies/index.mjs';
|
|
5
5
|
import '../../shared/better-auth.C24Bzw4w.mjs';
|
|
6
6
|
import '../../shared/better-auth.8zoxzg-F.mjs';
|
|
@@ -64,7 +64,16 @@ const multiSession = (options) => {
|
|
|
64
64
|
const validSessions = sessions.filter(
|
|
65
65
|
(session) => session && session.session.expiresAt > /* @__PURE__ */ new Date()
|
|
66
66
|
);
|
|
67
|
-
|
|
67
|
+
const uniqueUserSessions = validSessions.reduce(
|
|
68
|
+
(acc, session) => {
|
|
69
|
+
if (!acc.find((s) => s.user.id === session.user.id)) {
|
|
70
|
+
acc.push(session);
|
|
71
|
+
}
|
|
72
|
+
return acc;
|
|
73
|
+
},
|
|
74
|
+
[]
|
|
75
|
+
);
|
|
76
|
+
return ctx.json(uniqueUserSessions);
|
|
68
77
|
}
|
|
69
78
|
),
|
|
70
79
|
setActiveSession: createAuthEndpoint(
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const zod = require('zod');
|
|
4
4
|
require('better-call');
|
|
5
|
-
const account = require('../../shared/better-auth.
|
|
5
|
+
const account = require('../../shared/better-auth.D60yW05g.cjs');
|
|
6
6
|
const env = require('../../shared/better-auth.DiSjtgs9.cjs');
|
|
7
7
|
require('@better-auth/utils/base64');
|
|
8
8
|
require('@better-auth/utils/hmac');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import 'better-call';
|
|
3
|
-
import { c as createAuthMiddleware, a as createAuthEndpoint, o as originCheck } from '../../shared/better-auth.
|
|
3
|
+
import { c as createAuthMiddleware, a as createAuthEndpoint, o as originCheck } from '../../shared/better-auth.Dxynqa8m.mjs';
|
|
4
4
|
import { e as env } from '../../shared/better-auth.8zoxzg-F.mjs';
|
|
5
5
|
import '@better-auth/utils/base64';
|
|
6
6
|
import '@better-auth/utils/hmac';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const jose = require('jose');
|
|
4
4
|
const zod = require('zod');
|
|
5
5
|
const betterCall = require('better-call');
|
|
6
|
-
const account = require('../../shared/better-auth.
|
|
6
|
+
const account = require('../../shared/better-auth.D60yW05g.cjs');
|
|
7
7
|
require('../../shared/better-auth.DiSjtgs9.cjs');
|
|
8
8
|
const base64 = require('@better-auth/utils/base64');
|
|
9
9
|
require('@better-auth/utils/hmac');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SignJWT } from 'jose';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { APIError } from 'better-call';
|
|
4
|
-
import { g as getSessionFromCtx, a as createAuthEndpoint, c as createAuthMiddleware, s as sessionMiddleware } from '../../shared/better-auth.
|
|
4
|
+
import { g as getSessionFromCtx, a as createAuthEndpoint, c as createAuthMiddleware, s as sessionMiddleware } from '../../shared/better-auth.Dxynqa8m.mjs';
|
|
5
5
|
import '../../shared/better-auth.8zoxzg-F.mjs';
|
|
6
6
|
import { base64 } from '@better-auth/utils/base64';
|
|
7
7
|
import '@better-auth/utils/hmac';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const zod = require('zod');
|
|
4
4
|
const betterCall = require('better-call');
|
|
5
|
-
const account = require('../../shared/better-auth.
|
|
5
|
+
const account = require('../../shared/better-auth.D60yW05g.cjs');
|
|
6
6
|
const cookies_index = require('../../cookies/index.cjs');
|
|
7
7
|
require('../../shared/better-auth.CHyZMcYK.cjs');
|
|
8
8
|
require('../../shared/better-auth.DiSjtgs9.cjs');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { APIError } from 'better-call';
|
|
3
|
-
import { a as createAuthEndpoint } from '../../shared/better-auth.
|
|
3
|
+
import { a as createAuthEndpoint } from '../../shared/better-auth.Dxynqa8m.mjs';
|
|
4
4
|
import { setSessionCookie } from '../../cookies/index.mjs';
|
|
5
5
|
import '../../shared/better-auth.C24Bzw4w.mjs';
|
|
6
6
|
import '../../shared/better-auth.8zoxzg-F.mjs';
|
|
@@ -20,7 +20,7 @@ require('../../shared/better-auth.CYeOI8C-.cjs');
|
|
|
20
20
|
require('../../shared/better-auth.GpOOav9x.cjs');
|
|
21
21
|
const getTables = require('../../shared/better-auth.BEphVDyL.cjs');
|
|
22
22
|
require('kysely');
|
|
23
|
-
const account = require('../../shared/better-auth.
|
|
23
|
+
const account = require('../../shared/better-auth.D60yW05g.cjs');
|
|
24
24
|
require('@better-auth/utils/hmac');
|
|
25
25
|
require('defu');
|
|
26
26
|
require('../../cookies/index.cjs');
|
|
@@ -18,7 +18,7 @@ import '../../shared/better-auth.B4Qoxdgc.mjs';
|
|
|
18
18
|
import '../../shared/better-auth.DH3YjMQH.mjs';
|
|
19
19
|
import { g as getAuthTables } from '../../shared/better-auth.DORkW_Ge.mjs';
|
|
20
20
|
import 'kysely';
|
|
21
|
-
import { a as createAuthEndpoint } from '../../shared/better-auth.
|
|
21
|
+
import { a as createAuthEndpoint } from '../../shared/better-auth.Dxynqa8m.mjs';
|
|
22
22
|
import '@better-auth/utils/hmac';
|
|
23
23
|
import 'defu';
|
|
24
24
|
import '../../cookies/index.mjs';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const organization = require('../../shared/better-auth.
|
|
3
|
+
const organization = require('../../shared/better-auth.BTKX27-D.cjs');
|
|
4
4
|
require('better-call');
|
|
5
5
|
require('zod');
|
|
6
|
-
require('../../shared/better-auth.
|
|
6
|
+
require('../../shared/better-auth.D60yW05g.cjs');
|
|
7
7
|
require('../../cookies/index.cjs');
|
|
8
8
|
require('../../shared/better-auth.ANpbi45u.cjs');
|
|
9
9
|
require('../../shared/better-auth.C1hdVENX.cjs');
|
|
@@ -34,7 +34,7 @@ require('../../shared/better-auth.BMYo0QR-.cjs');
|
|
|
34
34
|
require('../../shared/better-auth.DhfiEsxl.cjs');
|
|
35
35
|
require('jose/errors');
|
|
36
36
|
require('@better-auth/utils/binary');
|
|
37
|
-
require('../../shared/better-auth.
|
|
37
|
+
require('../../shared/better-auth.CbfLzmYA.cjs');
|
|
38
38
|
require('../../shared/better-auth.DhsGZ30Q.cjs');
|
|
39
39
|
require('./access/index.cjs');
|
|
40
40
|
require('../access/index.cjs');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { o as organization } from '../../shared/better-auth.
|
|
1
|
+
export { o as organization } from '../../shared/better-auth.x7nh5kI2.mjs';
|
|
2
2
|
import 'better-call';
|
|
3
3
|
import 'zod';
|
|
4
|
-
import '../../shared/better-auth.
|
|
4
|
+
import '../../shared/better-auth.Dxynqa8m.mjs';
|
|
5
5
|
import '../../cookies/index.mjs';
|
|
6
6
|
import '../../shared/better-auth.DdzSJf-n.mjs';
|
|
7
7
|
import '../../shared/better-auth.CW6D9eSx.mjs';
|
|
@@ -32,7 +32,7 @@ import '../../shared/better-auth.DDEbWX-S.mjs';
|
|
|
32
32
|
import '../../shared/better-auth.NcLhHEks.mjs';
|
|
33
33
|
import 'jose/errors';
|
|
34
34
|
import '@better-auth/utils/binary';
|
|
35
|
-
import '../../shared/better-auth.
|
|
35
|
+
import '../../shared/better-auth.CcttI6Ga.mjs';
|
|
36
36
|
import '../../shared/better-auth.ffWeg50w.mjs';
|
|
37
37
|
import './access/index.mjs';
|
|
38
38
|
import '../access/index.mjs';
|
|
@@ -4,7 +4,7 @@ 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 account = require('../../shared/better-auth.
|
|
7
|
+
const account = require('../../shared/better-auth.D60yW05g.cjs');
|
|
8
8
|
const cookies_index = require('../../cookies/index.cjs');
|
|
9
9
|
const schema$1 = require('../../shared/better-auth.CHyZMcYK.cjs');
|
|
10
10
|
require('../../shared/better-auth.DiSjtgs9.cjs');
|
|
@@ -2,7 +2,7 @@ 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.Dxynqa8m.mjs';
|
|
6
6
|
import { setSessionCookie } from '../../cookies/index.mjs';
|
|
7
7
|
import { m as mergeSchema } from '../../shared/better-auth.C24Bzw4w.mjs';
|
|
8
8
|
import '../../shared/better-auth.8zoxzg-F.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zod = require('zod');
|
|
4
|
-
const account = require('../../shared/better-auth.
|
|
4
|
+
const account = require('../../shared/better-auth.D60yW05g.cjs');
|
|
5
5
|
const betterCall = require('better-call');
|
|
6
6
|
const schema$1 = require('../../shared/better-auth.CHyZMcYK.cjs');
|
|
7
7
|
const random = require('../../shared/better-auth.CYeOI8C-.cjs');
|
|
@@ -49,6 +49,7 @@ const phoneNumber = (options) => {
|
|
|
49
49
|
};
|
|
50
50
|
const ERROR_CODES = {
|
|
51
51
|
INVALID_PHONE_NUMBER: "Invalid phone number",
|
|
52
|
+
PHONE_NUMBER_EXIST: "Phone number already exist",
|
|
52
53
|
INVALID_PHONE_NUMBER_OR_PASSWORD: "Invalid phone number or password",
|
|
53
54
|
UNEXPECTED_ERROR: "Unexpected error",
|
|
54
55
|
OTP_NOT_FOUND: "OTP not found",
|
|
@@ -356,6 +357,20 @@ const phoneNumber = (options) => {
|
|
|
356
357
|
message: account.BASE_ERROR_CODES.USER_NOT_FOUND
|
|
357
358
|
});
|
|
358
359
|
}
|
|
360
|
+
const existingUser = await ctx.context.adapter.findMany({
|
|
361
|
+
model: "user",
|
|
362
|
+
where: [
|
|
363
|
+
{
|
|
364
|
+
field: "phoneNumber",
|
|
365
|
+
value: ctx.body.phoneNumber
|
|
366
|
+
}
|
|
367
|
+
]
|
|
368
|
+
});
|
|
369
|
+
if (existingUser.length) {
|
|
370
|
+
throw ctx.error("BAD_REQUEST", {
|
|
371
|
+
message: ERROR_CODES.PHONE_NUMBER_EXIST
|
|
372
|
+
});
|
|
373
|
+
}
|
|
359
374
|
let user2 = await ctx.context.internalAdapter.updateUser(
|
|
360
375
|
session.user.id,
|
|
361
376
|
{
|
|
@@ -453,6 +453,7 @@ declare const phoneNumber: (options?: PhoneNumberOptions) => {
|
|
|
453
453
|
};
|
|
454
454
|
$ERROR_CODES: {
|
|
455
455
|
readonly INVALID_PHONE_NUMBER: "Invalid phone number";
|
|
456
|
+
readonly PHONE_NUMBER_EXIST: "Phone number already exist";
|
|
456
457
|
readonly INVALID_PHONE_NUMBER_OR_PASSWORD: "Invalid phone number or password";
|
|
457
458
|
readonly UNEXPECTED_ERROR: "Unexpected error";
|
|
458
459
|
readonly OTP_NOT_FOUND: "OTP not found";
|
|
@@ -453,6 +453,7 @@ declare const phoneNumber: (options?: PhoneNumberOptions) => {
|
|
|
453
453
|
};
|
|
454
454
|
$ERROR_CODES: {
|
|
455
455
|
readonly INVALID_PHONE_NUMBER: "Invalid phone number";
|
|
456
|
+
readonly PHONE_NUMBER_EXIST: "Phone number already exist";
|
|
456
457
|
readonly INVALID_PHONE_NUMBER_OR_PASSWORD: "Invalid phone number or password";
|
|
457
458
|
readonly UNEXPECTED_ERROR: "Unexpected error";
|
|
458
459
|
readonly OTP_NOT_FOUND: "OTP not found";
|
|
@@ -453,6 +453,7 @@ declare const phoneNumber: (options?: PhoneNumberOptions) => {
|
|
|
453
453
|
};
|
|
454
454
|
$ERROR_CODES: {
|
|
455
455
|
readonly INVALID_PHONE_NUMBER: "Invalid phone number";
|
|
456
|
+
readonly PHONE_NUMBER_EXIST: "Phone number already exist";
|
|
456
457
|
readonly INVALID_PHONE_NUMBER_OR_PASSWORD: "Invalid phone number or password";
|
|
457
458
|
readonly UNEXPECTED_ERROR: "Unexpected error";
|
|
458
459
|
readonly OTP_NOT_FOUND: "OTP not found";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { a as createAuthEndpoint, g as getSessionFromCtx, B as BASE_ERROR_CODES } from '../../shared/better-auth.
|
|
2
|
+
import { a as createAuthEndpoint, g as getSessionFromCtx, B as BASE_ERROR_CODES } from '../../shared/better-auth.Dxynqa8m.mjs';
|
|
3
3
|
import { APIError } from 'better-call';
|
|
4
4
|
import { m as mergeSchema } from '../../shared/better-auth.C24Bzw4w.mjs';
|
|
5
5
|
import { g as generateRandomString } from '../../shared/better-auth.B4Qoxdgc.mjs';
|
|
@@ -47,6 +47,7 @@ const phoneNumber = (options) => {
|
|
|
47
47
|
};
|
|
48
48
|
const ERROR_CODES = {
|
|
49
49
|
INVALID_PHONE_NUMBER: "Invalid phone number",
|
|
50
|
+
PHONE_NUMBER_EXIST: "Phone number already exist",
|
|
50
51
|
INVALID_PHONE_NUMBER_OR_PASSWORD: "Invalid phone number or password",
|
|
51
52
|
UNEXPECTED_ERROR: "Unexpected error",
|
|
52
53
|
OTP_NOT_FOUND: "OTP not found",
|
|
@@ -354,6 +355,20 @@ const phoneNumber = (options) => {
|
|
|
354
355
|
message: BASE_ERROR_CODES.USER_NOT_FOUND
|
|
355
356
|
});
|
|
356
357
|
}
|
|
358
|
+
const existingUser = await ctx.context.adapter.findMany({
|
|
359
|
+
model: "user",
|
|
360
|
+
where: [
|
|
361
|
+
{
|
|
362
|
+
field: "phoneNumber",
|
|
363
|
+
value: ctx.body.phoneNumber
|
|
364
|
+
}
|
|
365
|
+
]
|
|
366
|
+
});
|
|
367
|
+
if (existingUser.length) {
|
|
368
|
+
throw ctx.error("BAD_REQUEST", {
|
|
369
|
+
message: ERROR_CODES.PHONE_NUMBER_EXIST
|
|
370
|
+
});
|
|
371
|
+
}
|
|
357
372
|
let user2 = await ctx.context.internalAdapter.updateUser(
|
|
358
373
|
session.user.id,
|
|
359
374
|
{
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const zod = require('zod');
|
|
4
4
|
const betterCall = require('better-call');
|
|
5
|
-
const account = require('../../shared/better-auth.
|
|
5
|
+
const account = require('../../shared/better-auth.D60yW05g.cjs');
|
|
6
6
|
const cookies_index = require('../../cookies/index.cjs');
|
|
7
7
|
require('../../shared/better-auth.CHyZMcYK.cjs');
|
|
8
8
|
require('../../shared/better-auth.DiSjtgs9.cjs');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { APIError } from 'better-call';
|
|
3
|
-
import { a as createAuthEndpoint, h as handleOAuthUserInfo, s as sessionMiddleware } from '../../shared/better-auth.
|
|
3
|
+
import { a as createAuthEndpoint, h as handleOAuthUserInfo, s as sessionMiddleware } from '../../shared/better-auth.Dxynqa8m.mjs';
|
|
4
4
|
import { setSessionCookie } from '../../cookies/index.mjs';
|
|
5
5
|
import '../../shared/better-auth.C24Bzw4w.mjs';
|
|
6
6
|
import '../../shared/better-auth.8zoxzg-F.mjs';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const random = require('../../shared/better-auth.CYeOI8C-.cjs');
|
|
4
4
|
const zod = require('zod');
|
|
5
|
-
const account = require('../../shared/better-auth.
|
|
5
|
+
const account = require('../../shared/better-auth.D60yW05g.cjs');
|
|
6
6
|
const betterCall = require('better-call');
|
|
7
7
|
const cookies_index = require('../../cookies/index.cjs');
|
|
8
8
|
const schema$1 = require('../../shared/better-auth.CHyZMcYK.cjs');
|
|
@@ -10,7 +10,7 @@ require('../../shared/better-auth.DiSjtgs9.cjs');
|
|
|
10
10
|
require('../../shared/better-auth.GpOOav9x.cjs');
|
|
11
11
|
require('defu');
|
|
12
12
|
const crypto_index = require('../../crypto/index.cjs');
|
|
13
|
-
const verifyMiddleware = require('../../shared/better-auth.
|
|
13
|
+
const verifyMiddleware = require('../../shared/better-auth.DWy7mPjr.cjs');
|
|
14
14
|
const errorCode = require('../../shared/better-auth.C1-vpKly.cjs');
|
|
15
15
|
require('@better-auth/utils/hash');
|
|
16
16
|
require('@noble/ciphers/chacha');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { g as generateRandomString } from '../../shared/better-auth.B4Qoxdgc.mjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { a as createAuthEndpoint, s as sessionMiddleware, c as createAuthMiddleware, B as BASE_ERROR_CODES } from '../../shared/better-auth.
|
|
3
|
+
import { a as createAuthEndpoint, s as sessionMiddleware, c as createAuthMiddleware, B as BASE_ERROR_CODES } from '../../shared/better-auth.Dxynqa8m.mjs';
|
|
4
4
|
import { APIError } from 'better-call';
|
|
5
5
|
import { setSessionCookie, deleteSessionCookie } from '../../cookies/index.mjs';
|
|
6
6
|
import { m as mergeSchema } from '../../shared/better-auth.C24Bzw4w.mjs';
|
|
@@ -8,7 +8,7 @@ import '../../shared/better-auth.8zoxzg-F.mjs';
|
|
|
8
8
|
import '../../shared/better-auth.DH3YjMQH.mjs';
|
|
9
9
|
import 'defu';
|
|
10
10
|
import { symmetricEncrypt, symmetricDecrypt } from '../../crypto/index.mjs';
|
|
11
|
-
import { v as verifyTwoFactorMiddleware, T as TRUST_DEVICE_COOKIE_NAME, a as TWO_FACTOR_COOKIE_NAME } from '../../shared/better-auth.
|
|
11
|
+
import { v as verifyTwoFactorMiddleware, T as TRUST_DEVICE_COOKIE_NAME, a as TWO_FACTOR_COOKIE_NAME } from '../../shared/better-auth.vVUb_2f5.mjs';
|
|
12
12
|
import { T as TWO_FACTOR_ERROR_CODES } from '../../shared/better-auth.BcoSd9tC.mjs';
|
|
13
13
|
import '@better-auth/utils/hash';
|
|
14
14
|
import '@noble/ciphers/chacha';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zod = require('zod');
|
|
4
|
-
const account = require('../../shared/better-auth.
|
|
4
|
+
const account = require('../../shared/better-auth.D60yW05g.cjs');
|
|
5
5
|
const betterCall = require('better-call');
|
|
6
6
|
const cookies_index = require('../../cookies/index.cjs');
|
|
7
7
|
const schema$1 = require('../../shared/better-auth.CHyZMcYK.cjs');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { c as createAuthMiddleware, a as createAuthEndpoint, b as sendVerificationEmailFn, B as BASE_ERROR_CODES } from '../../shared/better-auth.
|
|
2
|
+
import { c as createAuthMiddleware, a as createAuthEndpoint, b as sendVerificationEmailFn, B as BASE_ERROR_CODES } from '../../shared/better-auth.Dxynqa8m.mjs';
|
|
3
3
|
import { APIError } from 'better-call';
|
|
4
4
|
import { setSessionCookie } from '../../cookies/index.mjs';
|
|
5
5
|
import { m as mergeSchema } from '../../shared/better-auth.C24Bzw4w.mjs';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const zod = require('zod');
|
|
4
4
|
const betterCall = require('better-call');
|
|
5
|
-
const account = require('./better-auth.
|
|
5
|
+
const account = require('./better-auth.D60yW05g.cjs');
|
|
6
6
|
const cookies_index = require('../cookies/index.cjs');
|
|
7
7
|
const schema$1 = require('./better-auth.CHyZMcYK.cjs');
|
|
8
8
|
require('./better-auth.DiSjtgs9.cjs');
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
const betterCall = require('better-call');
|
|
4
4
|
const zod = require('zod');
|
|
5
|
-
const account = require('./better-auth.
|
|
5
|
+
const account = require('./better-auth.D60yW05g.cjs');
|
|
6
6
|
require('./better-auth.DiSjtgs9.cjs');
|
|
7
7
|
require('@better-auth/utils/base64');
|
|
8
8
|
require('@better-auth/utils/hmac');
|
|
9
9
|
require('./better-auth.CHyZMcYK.cjs');
|
|
10
|
-
const crudTeam = require('./better-auth.
|
|
10
|
+
const crudTeam = require('./better-auth.CbfLzmYA.cjs');
|
|
11
11
|
const plugins_organization_access_index = require('../plugins/organization/access/index.cjs');
|
|
12
12
|
|
|
13
13
|
const shimContext = (originalObject, newContext) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zod = require('zod');
|
|
4
|
-
const account = require('./better-auth.
|
|
4
|
+
const account = require('./better-auth.D60yW05g.cjs');
|
|
5
5
|
require('./better-auth.DiSjtgs9.cjs');
|
|
6
6
|
require('@better-auth/utils/base64');
|
|
7
7
|
require('@better-auth/utils/hmac');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { c as createAuthMiddleware, s as sessionMiddleware, a as createAuthEndpoint, g as getSessionFromCtx, B as BASE_ERROR_CODES, M as requestOnlySessionMiddleware } from './better-auth.
|
|
2
|
+
import { c as createAuthMiddleware, s as sessionMiddleware, a as createAuthEndpoint, g as getSessionFromCtx, B as BASE_ERROR_CODES, M as requestOnlySessionMiddleware } from './better-auth.Dxynqa8m.mjs';
|
|
3
3
|
import './better-auth.8zoxzg-F.mjs';
|
|
4
4
|
import '@better-auth/utils/base64';
|
|
5
5
|
import '@better-auth/utils/hmac';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { APIError } from 'better-call';
|
|
3
|
-
import { c as createAuthMiddleware, g as getSessionFromCtx, a as createAuthEndpoint } from './better-auth.
|
|
3
|
+
import { c as createAuthMiddleware, g as getSessionFromCtx, a as createAuthEndpoint } from './better-auth.Dxynqa8m.mjs';
|
|
4
4
|
import { setSessionCookie, deleteSessionCookie } from '../cookies/index.mjs';
|
|
5
5
|
import { m as mergeSchema } from './better-auth.C24Bzw4w.mjs';
|
|
6
6
|
import './better-auth.8zoxzg-F.mjs';
|
|
@@ -2577,15 +2577,14 @@ const changeEmail = createAuthEndpoint(
|
|
|
2577
2577
|
message: "Change email is disabled"
|
|
2578
2578
|
});
|
|
2579
2579
|
}
|
|
2580
|
-
|
|
2580
|
+
const newEmail = ctx.body.newEmail.toLowerCase();
|
|
2581
|
+
if (newEmail === ctx.context.session.user.email) {
|
|
2581
2582
|
ctx.context.logger.error("Email is the same");
|
|
2582
2583
|
throw new betterCall.APIError("BAD_REQUEST", {
|
|
2583
2584
|
message: "Email is the same"
|
|
2584
2585
|
});
|
|
2585
2586
|
}
|
|
2586
|
-
const existingUser = await ctx.context.internalAdapter.findUserByEmail(
|
|
2587
|
-
ctx.body.newEmail
|
|
2588
|
-
);
|
|
2587
|
+
const existingUser = await ctx.context.internalAdapter.findUserByEmail(newEmail);
|
|
2589
2588
|
if (existingUser) {
|
|
2590
2589
|
ctx.context.logger.error("Email already exists");
|
|
2591
2590
|
throw new betterCall.APIError("BAD_REQUEST", {
|
|
@@ -2593,9 +2592,7 @@ const changeEmail = createAuthEndpoint(
|
|
|
2593
2592
|
});
|
|
2594
2593
|
}
|
|
2595
2594
|
if (ctx.context.session.user.emailVerified !== true) {
|
|
2596
|
-
const existing = await ctx.context.internalAdapter.findUserByEmail(
|
|
2597
|
-
ctx.body.newEmail
|
|
2598
|
-
);
|
|
2595
|
+
const existing = await ctx.context.internalAdapter.findUserByEmail(newEmail);
|
|
2599
2596
|
if (existing) {
|
|
2600
2597
|
throw new betterCall.APIError("UNPROCESSABLE_ENTITY", {
|
|
2601
2598
|
message: BASE_ERROR_CODES.USER_ALREADY_EXISTS
|
|
@@ -2604,7 +2601,7 @@ const changeEmail = createAuthEndpoint(
|
|
|
2604
2601
|
await ctx.context.internalAdapter.updateUserByEmail(
|
|
2605
2602
|
ctx.context.session.user.email,
|
|
2606
2603
|
{
|
|
2607
|
-
email:
|
|
2604
|
+
email: newEmail
|
|
2608
2605
|
},
|
|
2609
2606
|
ctx
|
|
2610
2607
|
);
|
|
@@ -2612,14 +2609,14 @@ const changeEmail = createAuthEndpoint(
|
|
|
2612
2609
|
session: ctx.context.session.session,
|
|
2613
2610
|
user: {
|
|
2614
2611
|
...ctx.context.session.user,
|
|
2615
|
-
email:
|
|
2612
|
+
email: newEmail
|
|
2616
2613
|
}
|
|
2617
2614
|
});
|
|
2618
2615
|
if (ctx.context.options.emailVerification?.sendVerificationEmail) {
|
|
2619
2616
|
const token2 = await createEmailVerificationToken(
|
|
2620
2617
|
ctx.context.secret,
|
|
2621
2618
|
ctx.context.session.user.email,
|
|
2622
|
-
|
|
2619
|
+
newEmail,
|
|
2623
2620
|
ctx.context.options.emailVerification?.expiresIn
|
|
2624
2621
|
);
|
|
2625
2622
|
const url2 = `${ctx.context.baseURL}/verify-email?token=${token2}&callbackURL=${ctx.body.callbackURL || "/"}`;
|
|
@@ -2627,7 +2624,7 @@ const changeEmail = createAuthEndpoint(
|
|
|
2627
2624
|
{
|
|
2628
2625
|
user: {
|
|
2629
2626
|
...ctx.context.session.user,
|
|
2630
|
-
email:
|
|
2627
|
+
email: newEmail
|
|
2631
2628
|
},
|
|
2632
2629
|
url: url2,
|
|
2633
2630
|
token: token2
|
|
@@ -2648,14 +2645,14 @@ const changeEmail = createAuthEndpoint(
|
|
|
2648
2645
|
const token = await createEmailVerificationToken(
|
|
2649
2646
|
ctx.context.secret,
|
|
2650
2647
|
ctx.context.session.user.email,
|
|
2651
|
-
|
|
2648
|
+
newEmail,
|
|
2652
2649
|
ctx.context.options.emailVerification?.expiresIn
|
|
2653
2650
|
);
|
|
2654
2651
|
const url = `${ctx.context.baseURL}/verify-email?token=${token}&callbackURL=${ctx.body.callbackURL || "/"}`;
|
|
2655
2652
|
await ctx.context.options.user.changeEmail.sendChangeEmailVerification(
|
|
2656
2653
|
{
|
|
2657
2654
|
user: ctx.context.session.user,
|
|
2658
|
-
newEmail
|
|
2655
|
+
newEmail,
|
|
2659
2656
|
url,
|
|
2660
2657
|
token
|
|
2661
2658
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const betterCall = require('better-call');
|
|
4
|
-
const account = require('./better-auth.
|
|
4
|
+
const account = require('./better-auth.D60yW05g.cjs');
|
|
5
5
|
const cookies_index = require('../cookies/index.cjs');
|
|
6
6
|
const zod = require('zod');
|
|
7
7
|
require('./better-auth.CHyZMcYK.cjs');
|
|
@@ -2575,15 +2575,14 @@ const changeEmail = createAuthEndpoint(
|
|
|
2575
2575
|
message: "Change email is disabled"
|
|
2576
2576
|
});
|
|
2577
2577
|
}
|
|
2578
|
-
|
|
2578
|
+
const newEmail = ctx.body.newEmail.toLowerCase();
|
|
2579
|
+
if (newEmail === ctx.context.session.user.email) {
|
|
2579
2580
|
ctx.context.logger.error("Email is the same");
|
|
2580
2581
|
throw new APIError("BAD_REQUEST", {
|
|
2581
2582
|
message: "Email is the same"
|
|
2582
2583
|
});
|
|
2583
2584
|
}
|
|
2584
|
-
const existingUser = await ctx.context.internalAdapter.findUserByEmail(
|
|
2585
|
-
ctx.body.newEmail
|
|
2586
|
-
);
|
|
2585
|
+
const existingUser = await ctx.context.internalAdapter.findUserByEmail(newEmail);
|
|
2587
2586
|
if (existingUser) {
|
|
2588
2587
|
ctx.context.logger.error("Email already exists");
|
|
2589
2588
|
throw new APIError("BAD_REQUEST", {
|
|
@@ -2591,9 +2590,7 @@ const changeEmail = createAuthEndpoint(
|
|
|
2591
2590
|
});
|
|
2592
2591
|
}
|
|
2593
2592
|
if (ctx.context.session.user.emailVerified !== true) {
|
|
2594
|
-
const existing = await ctx.context.internalAdapter.findUserByEmail(
|
|
2595
|
-
ctx.body.newEmail
|
|
2596
|
-
);
|
|
2593
|
+
const existing = await ctx.context.internalAdapter.findUserByEmail(newEmail);
|
|
2597
2594
|
if (existing) {
|
|
2598
2595
|
throw new APIError("UNPROCESSABLE_ENTITY", {
|
|
2599
2596
|
message: BASE_ERROR_CODES.USER_ALREADY_EXISTS
|
|
@@ -2602,7 +2599,7 @@ const changeEmail = createAuthEndpoint(
|
|
|
2602
2599
|
await ctx.context.internalAdapter.updateUserByEmail(
|
|
2603
2600
|
ctx.context.session.user.email,
|
|
2604
2601
|
{
|
|
2605
|
-
email:
|
|
2602
|
+
email: newEmail
|
|
2606
2603
|
},
|
|
2607
2604
|
ctx
|
|
2608
2605
|
);
|
|
@@ -2610,14 +2607,14 @@ const changeEmail = createAuthEndpoint(
|
|
|
2610
2607
|
session: ctx.context.session.session,
|
|
2611
2608
|
user: {
|
|
2612
2609
|
...ctx.context.session.user,
|
|
2613
|
-
email:
|
|
2610
|
+
email: newEmail
|
|
2614
2611
|
}
|
|
2615
2612
|
});
|
|
2616
2613
|
if (ctx.context.options.emailVerification?.sendVerificationEmail) {
|
|
2617
2614
|
const token2 = await createEmailVerificationToken(
|
|
2618
2615
|
ctx.context.secret,
|
|
2619
2616
|
ctx.context.session.user.email,
|
|
2620
|
-
|
|
2617
|
+
newEmail,
|
|
2621
2618
|
ctx.context.options.emailVerification?.expiresIn
|
|
2622
2619
|
);
|
|
2623
2620
|
const url2 = `${ctx.context.baseURL}/verify-email?token=${token2}&callbackURL=${ctx.body.callbackURL || "/"}`;
|
|
@@ -2625,7 +2622,7 @@ const changeEmail = createAuthEndpoint(
|
|
|
2625
2622
|
{
|
|
2626
2623
|
user: {
|
|
2627
2624
|
...ctx.context.session.user,
|
|
2628
|
-
email:
|
|
2625
|
+
email: newEmail
|
|
2629
2626
|
},
|
|
2630
2627
|
url: url2,
|
|
2631
2628
|
token: token2
|
|
@@ -2646,14 +2643,14 @@ const changeEmail = createAuthEndpoint(
|
|
|
2646
2643
|
const token = await createEmailVerificationToken(
|
|
2647
2644
|
ctx.context.secret,
|
|
2648
2645
|
ctx.context.session.user.email,
|
|
2649
|
-
|
|
2646
|
+
newEmail,
|
|
2650
2647
|
ctx.context.options.emailVerification?.expiresIn
|
|
2651
2648
|
);
|
|
2652
2649
|
const url = `${ctx.context.baseURL}/verify-email?token=${token}&callbackURL=${ctx.body.callbackURL || "/"}`;
|
|
2653
2650
|
await ctx.context.options.user.changeEmail.sendChangeEmailVerification(
|
|
2654
2651
|
{
|
|
2655
2652
|
user: ctx.context.session.user,
|
|
2656
|
-
newEmail
|
|
2653
|
+
newEmail,
|
|
2657
2654
|
url,
|
|
2658
2655
|
token
|
|
2659
2656
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { APIError } from 'better-call';
|
|
2
|
-
import { c as createAuthMiddleware, g as getSessionFromCtx } from './better-auth.
|
|
2
|
+
import { c as createAuthMiddleware, g as getSessionFromCtx } from './better-auth.Dxynqa8m.mjs';
|
|
3
3
|
import { setSessionCookie } from '../cookies/index.mjs';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import './better-auth.C24Bzw4w.mjs';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { APIError } from 'better-call';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { a as createAuthEndpoint, g as getSessionFromCtx } from './better-auth.
|
|
3
|
+
import { a as createAuthEndpoint, g as getSessionFromCtx } from './better-auth.Dxynqa8m.mjs';
|
|
4
4
|
import './better-auth.8zoxzg-F.mjs';
|
|
5
5
|
import '@better-auth/utils/base64';
|
|
6
6
|
import '@better-auth/utils/hmac';
|
|
7
7
|
import './better-auth.C24Bzw4w.mjs';
|
|
8
|
-
import { u as updateMemberRole, a as addMember, c as createInvitation, g as getFullOrganization, s as setActiveOrganization, b as createTeam, d as updateTeam, r as removeTeam, l as listOrganizationTeams, e as leaveOrganization, f as getActiveMember, h as removeMember, i as checkOrganizationSlug, j as rejectInvitation, k as getInvitation, m as acceptInvitation, n as cancelInvitation, o as listOrganizations, p as deleteOrganization, q as updateOrganization, t as createOrganization, O as ORGANIZATION_ERROR_CODES, v as orgSessionMiddleware, w as getOrgAdapter, x as hasPermission } from './better-auth.
|
|
8
|
+
import { u as updateMemberRole, a as addMember, c as createInvitation, g as getFullOrganization, s as setActiveOrganization, b as createTeam, d as updateTeam, r as removeTeam, l as listOrganizationTeams, e as leaveOrganization, f as getActiveMember, h as removeMember, i as checkOrganizationSlug, j as rejectInvitation, k as getInvitation, m as acceptInvitation, n as cancelInvitation, o as listOrganizations, p as deleteOrganization, q as updateOrganization, t as createOrganization, O as ORGANIZATION_ERROR_CODES, v as orgSessionMiddleware, w as getOrgAdapter, x as hasPermission } from './better-auth.CcttI6Ga.mjs';
|
|
9
9
|
import { defaultRoles } from '../plugins/organization/access/index.mjs';
|
|
10
10
|
|
|
11
11
|
const shimContext = (originalObject, newContext) => {
|
|
@@ -1070,6 +1070,7 @@ const roblox = (options) => {
|
|
|
1070
1070
|
if (error) {
|
|
1071
1071
|
return null;
|
|
1072
1072
|
}
|
|
1073
|
+
const userMap = await options.mapProfileToUser?.(profile);
|
|
1073
1074
|
return {
|
|
1074
1075
|
user: {
|
|
1075
1076
|
id: profile.sub,
|
|
@@ -1077,7 +1078,8 @@ const roblox = (options) => {
|
|
|
1077
1078
|
image: profile.picture,
|
|
1078
1079
|
email: profile.preferred_username || null,
|
|
1079
1080
|
// Roblox does not provide email
|
|
1080
|
-
emailVerified: true
|
|
1081
|
+
emailVerified: true,
|
|
1082
|
+
...userMap
|
|
1081
1083
|
},
|
|
1082
1084
|
data: {
|
|
1083
1085
|
...profile
|
|
@@ -1068,6 +1068,7 @@ const roblox = (options) => {
|
|
|
1068
1068
|
if (error) {
|
|
1069
1069
|
return null;
|
|
1070
1070
|
}
|
|
1071
|
+
const userMap = await options.mapProfileToUser?.(profile);
|
|
1071
1072
|
return {
|
|
1072
1073
|
user: {
|
|
1073
1074
|
id: profile.sub,
|
|
@@ -1075,7 +1076,8 @@ const roblox = (options) => {
|
|
|
1075
1076
|
image: profile.picture,
|
|
1076
1077
|
email: profile.preferred_username || null,
|
|
1077
1078
|
// Roblox does not provide email
|
|
1078
|
-
emailVerified: true
|
|
1079
|
+
emailVerified: true,
|
|
1080
|
+
...userMap
|
|
1079
1081
|
},
|
|
1080
1082
|
data: {
|
|
1081
1083
|
...profile
|