@better-auth/core 1.4.0-beta.21 → 1.4.0-beta.23
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/.turbo/turbo-build.log +14 -14
- package/dist/api/index.d.mts +2 -2
- package/dist/api/index.mjs +2 -2
- package/dist/async_hooks/index.d.mts +1 -1
- package/dist/async_hooks/index.mjs +1 -1
- package/dist/context/index.d.mts +3 -3
- package/dist/context/index.mjs +2 -2
- package/dist/{context-Buud88Dd.mjs → context-DgQ9XGBl.mjs} +1 -1
- package/dist/db/adapter/index.d.mts +2 -2
- package/dist/db/index.d.mts +2 -2
- package/dist/env/index.d.mts +1 -1
- package/dist/env/index.mjs +1 -1
- package/dist/error/index.mjs +2 -2
- package/dist/{error-D6EqgOXr.mjs → error-BhAKg8LX.mjs} +1 -1
- package/dist/{index-DX7czw7K.d.mts → index-X4TpuzeM.d.mts} +21 -9
- package/dist/index.d.mts +2 -2
- package/dist/oauth2/index.d.mts +2 -2
- package/dist/oauth2/index.mjs +1 -1
- package/dist/social-providers/index.d.mts +2 -2
- package/dist/social-providers/index.mjs +5 -5
- package/dist/utils/index.mjs +1 -1
- package/package.json +3 -3
- package/src/api/index.ts +2 -6
- package/src/context/endpoint-context.ts +2 -1
- package/src/context/request-state.test.ts +1 -1
- package/src/context/request-state.ts +2 -1
- package/src/context/transaction.ts +2 -1
- package/src/env/logger.test.ts +2 -1
- package/src/social-providers/vk.ts +1 -2
- package/src/types/context.ts +1 -1
- package/src/types/init-options.ts +21 -8
- package/vitest.config.ts +3 -0
- /package/dist/{async_hooks-BQqSywfV.mjs → async_hooks-BfRfbd1J.mjs} +0 -0
- /package/dist/{env-YhoEXwYv.mjs → env-DwlNAN_D.mjs} +0 -0
- /package/dist/{index-JSfspfWW.d.mts → index-CdubV7uy.d.mts} +0 -0
- /package/dist/{index-CRg-E-VF.d.mts → index-DgwIISs7.d.mts} +0 -0
- /package/dist/{oauth2-D4PPavcA.mjs → oauth2-D3aE32ZH.mjs} +0 -0
- /package/dist/{utils-BFQCAfNW.mjs → utils-C5EN75oV.mjs} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
> @better-auth/core@1.4.0-beta.
|
|
2
|
+
> @better-auth/core@1.4.0-beta.23 build /home/runner/work/better-auth/better-auth/packages/core
|
|
3
3
|
> tsdown
|
|
4
4
|
|
|
5
|
-
[34mℹ[39m tsdown [2mv0.16.
|
|
5
|
+
[34mℹ[39m tsdown [2mv0.16.5[22m powered by rolldown [2mv1.0.0-beta.50[22m
|
|
6
6
|
[34mℹ[39m Using tsdown config: [4m/home/runner/work/better-auth/better-auth/packages/core/tsdown.config.ts[24m
|
|
7
|
-
[34mℹ[39m entry: [34msrc/index.ts, src/
|
|
7
|
+
[34mℹ[39m entry: [34msrc/index.ts, src/db/index.ts, src/db/adapter/index.ts, src/async_hooks/index.ts, src/context/index.ts, src/env/index.ts, src/oauth2/index.ts, src/api/index.ts, src/social-providers/index.ts, src/utils/index.ts, src/error/index.ts[39m
|
|
8
8
|
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
9
9
|
[34mℹ[39m Build start
|
|
10
10
|
[34mℹ[39m [2mdist/[22m[1msocial-providers/index.mjs[22m [2m 77.94 kB[22m [2m│ gzip: 10.14 kB[22m
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
[34mℹ[39m [2mdist/[22m[1mutils/index.mjs[22m [2m 0.09 kB[22m [2m│ gzip: 0.09 kB[22m
|
|
19
19
|
[34mℹ[39m [2mdist/[22m[1mdb/adapter/index.mjs[22m [2m 0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
20
20
|
[34mℹ[39m [2mdist/[22m[1mindex.mjs[22m [2m 0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
21
|
-
[34mℹ[39m [2mdist/[22moauth2-
|
|
22
|
-
[34mℹ[39m [2mdist/[22menv-
|
|
23
|
-
[34mℹ[39m [2mdist/[22mcontext-
|
|
24
|
-
[34mℹ[39m [2mdist/[22merror-
|
|
25
|
-
[34mℹ[39m [2mdist/[22masync_hooks-
|
|
26
|
-
[34mℹ[39m [2mdist/[22mutils-
|
|
21
|
+
[34mℹ[39m [2mdist/[22moauth2-D3aE32ZH.mjs [2m 9.16 kB[22m [2m│ gzip: 2.12 kB[22m
|
|
22
|
+
[34mℹ[39m [2mdist/[22menv-DwlNAN_D.mjs [2m 7.67 kB[22m [2m│ gzip: 2.54 kB[22m
|
|
23
|
+
[34mℹ[39m [2mdist/[22mcontext-DgQ9XGBl.mjs [2m 3.89 kB[22m [2m│ gzip: 1.00 kB[22m
|
|
24
|
+
[34mℹ[39m [2mdist/[22merror-BhAKg8LX.mjs [2m 1.77 kB[22m [2m│ gzip: 0.79 kB[22m
|
|
25
|
+
[34mℹ[39m [2mdist/[22masync_hooks-BfRfbd1J.mjs [2m 0.87 kB[22m [2m│ gzip: 0.46 kB[22m
|
|
26
|
+
[34mℹ[39m [2mdist/[22mutils-C5EN75oV.mjs [2m 0.13 kB[22m [2m│ gzip: 0.12 kB[22m
|
|
27
27
|
[34mℹ[39m [2mdist/[22m[32m[1msocial-providers/index.d.mts[22m[39m [2m 3.78 kB[22m [2m│ gzip: 1.17 kB[22m
|
|
28
28
|
[34mℹ[39m [2mdist/[22m[32m[1mcontext/index.d.mts[22m[39m [2m 3.05 kB[22m [2m│ gzip: 0.96 kB[22m
|
|
29
29
|
[34mℹ[39m [2mdist/[22m[32m[1merror/index.d.mts[22m[39m [2m 1.84 kB[22m [2m│ gzip: 0.72 kB[22m
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
[34mℹ[39m [2mdist/[22m[32m[1mdb/adapter/index.d.mts[22m[39m [2m 0.53 kB[22m [2m│ gzip: 0.25 kB[22m
|
|
36
36
|
[34mℹ[39m [2mdist/[22m[32m[1mapi/index.d.mts[22m[39m [2m 0.29 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
37
37
|
[34mℹ[39m [2mdist/[22m[32m[1masync_hooks/index.d.mts[22m[39m [2m 0.14 kB[22m [2m│ gzip: 0.10 kB[22m
|
|
38
|
-
[34mℹ[39m [2mdist/[22m[32mindex-
|
|
39
|
-
[34mℹ[39m [2mdist/[22m[32mindex-
|
|
40
|
-
[34mℹ[39m [2mdist/[22m[32mindex-
|
|
41
|
-
[34mℹ[39m 31 files, total: 327.
|
|
42
|
-
[32m✔[39m Build complete in [
|
|
38
|
+
[34mℹ[39m [2mdist/[22m[32mindex-X4TpuzeM.d.mts[39m [2m204.34 kB[22m [2m│ gzip: 32.16 kB[22m
|
|
39
|
+
[34mℹ[39m [2mdist/[22m[32mindex-CdubV7uy.d.mts[39m [2m 3.31 kB[22m [2m│ gzip: 1.11 kB[22m
|
|
40
|
+
[34mℹ[39m [2mdist/[22m[32mindex-DgwIISs7.d.mts[39m [2m 0.24 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
41
|
+
[34mℹ[39m 31 files, total: 327.60 kB
|
|
42
|
+
[32m✔[39m Build complete in [32m4494ms[39m
|
package/dist/api/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as optionsMiddleware, i as createAuthMiddleware, n as AuthMiddleware, r as createAuthEndpoint, t as AuthEndpoint } from "../index-
|
|
2
|
-
import "../index-
|
|
1
|
+
import { a as optionsMiddleware, i as createAuthMiddleware, n as AuthMiddleware, r as createAuthEndpoint, t as AuthEndpoint } from "../index-X4TpuzeM.mjs";
|
|
2
|
+
import "../index-CdubV7uy.mjs";
|
|
3
3
|
export { AuthEndpoint, AuthMiddleware, createAuthEndpoint, createAuthMiddleware, optionsMiddleware };
|
package/dist/api/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../async_hooks-
|
|
2
|
-
import { f as runWithEndpointContext } from "../context-
|
|
1
|
+
import "../async_hooks-BfRfbd1J.mjs";
|
|
2
|
+
import { f as runWithEndpointContext } from "../context-DgQ9XGBl.mjs";
|
|
3
3
|
import { createEndpoint, createMiddleware } from "better-call";
|
|
4
4
|
|
|
5
5
|
//#region src/api/index.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as getAsyncLocalStorage, t as AsyncLocalStorage } from "../index-
|
|
1
|
+
import { n as getAsyncLocalStorage, t as AsyncLocalStorage } from "../index-DgwIISs7.mjs";
|
|
2
2
|
export { AsyncLocalStorage, getAsyncLocalStorage };
|
package/dist/context/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Jn as DBTransactionAdapter, Un as DBAdapter, d as AuthContext } from "../index-
|
|
2
|
-
import "../index-
|
|
3
|
-
import { t as AsyncLocalStorage } from "../index-
|
|
1
|
+
import { Jn as DBTransactionAdapter, Un as DBAdapter, d as AuthContext } from "../index-X4TpuzeM.mjs";
|
|
2
|
+
import "../index-CdubV7uy.mjs";
|
|
3
|
+
import { t as AsyncLocalStorage } from "../index-DgwIISs7.mjs";
|
|
4
4
|
import { EndpointContext, InputContext } from "better-call";
|
|
5
5
|
|
|
6
6
|
//#region src/context/endpoint-context.d.ts
|
package/dist/context/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../async_hooks-
|
|
2
|
-
import { a as defineRequestState, c as hasRequestState, d as getCurrentAuthContextAsyncLocalStorage, f as runWithEndpointContext, i as runWithTransaction, l as runWithRequestState, n as getCurrentDBAdapterAsyncLocalStorage, o as getCurrentRequestState, r as runWithAdapter, s as getRequestStateAsyncLocalStorage, t as getCurrentAdapter, u as getCurrentAuthContext } from "../context-
|
|
1
|
+
import "../async_hooks-BfRfbd1J.mjs";
|
|
2
|
+
import { a as defineRequestState, c as hasRequestState, d as getCurrentAuthContextAsyncLocalStorage, f as runWithEndpointContext, i as runWithTransaction, l as runWithRequestState, n as getCurrentDBAdapterAsyncLocalStorage, o as getCurrentRequestState, r as runWithAdapter, s as getRequestStateAsyncLocalStorage, t as getCurrentAdapter, u as getCurrentAuthContext } from "../context-DgQ9XGBl.mjs";
|
|
3
3
|
|
|
4
4
|
export { defineRequestState, getCurrentAdapter, getCurrentAuthContext, getCurrentAuthContextAsyncLocalStorage, getCurrentDBAdapterAsyncLocalStorage, getCurrentRequestState, getRequestStateAsyncLocalStorage, hasRequestState, runWithAdapter, runWithEndpointContext, runWithRequestState, runWithTransaction };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Gn as DBAdapterFactoryConfig, Hn as CustomAdapter, Jn as DBTransactionAdapter, Kn as DBAdapterInstance, Un as DBAdapter, Vn as CleanedWhere, Wn as DBAdapterDebugLogOption, Xn as JoinOption, Yn as JoinConfig, Zn as Where, qn as DBAdapterSchemaCreation } from "../../index-
|
|
2
|
-
import "../../index-
|
|
1
|
+
import { Gn as DBAdapterFactoryConfig, Hn as CustomAdapter, Jn as DBTransactionAdapter, Kn as DBAdapterInstance, Un as DBAdapter, Vn as CleanedWhere, Wn as DBAdapterDebugLogOption, Xn as JoinOption, Yn as JoinConfig, Zn as Where, qn as DBAdapterSchemaCreation } from "../../index-X4TpuzeM.mjs";
|
|
2
|
+
import "../../index-CdubV7uy.mjs";
|
|
3
3
|
export { CleanedWhere, CustomAdapter, DBAdapter, DBAdapterDebugLogOption, DBAdapterFactoryConfig, DBAdapterInstance, DBAdapterSchemaCreation, DBTransactionAdapter, JoinConfig, JoinOption, Where };
|
package/dist/db/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $n as BetterAuthDbSchema, Qn as AuthPluginSchema, Sr as SecondaryStorage, _r as DBFieldAttribute, ar as verificationSchema, br as DBPreservedModels, cr as coreSchema, dr as RateLimit, er as FieldAttribute, fr as rateLimitSchema, gr as BetterAuthDBSchema, hr as BetterAuthPluginDBSchema, ir as Verification, lr as Session, mr as accountSchema, nr as FieldType, or as User, pr as Account, rr as Primitive, sr as userSchema, tr as FieldAttributeConfig, ur as sessionSchema, vr as DBFieldAttributeConfig, xr as DBPrimitive, yr as DBFieldType } from "../index-
|
|
2
|
-
import "../index-
|
|
1
|
+
import { $n as BetterAuthDbSchema, Qn as AuthPluginSchema, Sr as SecondaryStorage, _r as DBFieldAttribute, ar as verificationSchema, br as DBPreservedModels, cr as coreSchema, dr as RateLimit, er as FieldAttribute, fr as rateLimitSchema, gr as BetterAuthDBSchema, hr as BetterAuthPluginDBSchema, ir as Verification, lr as Session, mr as accountSchema, nr as FieldType, or as User, pr as Account, rr as Primitive, sr as userSchema, tr as FieldAttributeConfig, ur as sessionSchema, vr as DBFieldAttributeConfig, xr as DBPrimitive, yr as DBFieldType } from "../index-X4TpuzeM.mjs";
|
|
2
|
+
import "../index-CdubV7uy.mjs";
|
|
3
3
|
export { Account, AuthPluginSchema, BetterAuthDBSchema, BetterAuthDbSchema, BetterAuthPluginDBSchema, DBFieldAttribute, DBFieldAttributeConfig, DBFieldType, DBPreservedModels, DBPrimitive, FieldAttribute, FieldAttributeConfig, FieldType, Primitive, RateLimit, SecondaryStorage, Session, User, Verification, accountSchema, coreSchema, rateLimitSchema, sessionSchema, userSchema, verificationSchema };
|
package/dist/env/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as isTest, a as TTY_COLORS, c as logger, d as EnvObject, f as env, g as isProduction, h as isDevelopment, i as Logger, l as shouldPublishLog, m as getEnvVar, n as LogHandlerParams, o as createLogger, p as getBooleanEnvVar, r as LogLevel, s as levels, t as InternalLogger, u as ENV, v as nodeENV, y as getColorDepth } from "../index-
|
|
1
|
+
import { _ as isTest, a as TTY_COLORS, c as logger, d as EnvObject, f as env, g as isProduction, h as isDevelopment, i as Logger, l as shouldPublishLog, m as getEnvVar, n as LogHandlerParams, o as createLogger, p as getBooleanEnvVar, r as LogLevel, s as levels, t as InternalLogger, u as ENV, v as nodeENV, y as getColorDepth } from "../index-CdubV7uy.mjs";
|
|
2
2
|
export { ENV, EnvObject, InternalLogger, LogHandlerParams, LogLevel, Logger, TTY_COLORS, createLogger, env, getBooleanEnvVar, getColorDepth, getEnvVar, isDevelopment, isProduction, isTest, levels, logger, nodeENV, shouldPublishLog };
|
package/dist/env/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as shouldPublishLog, c as env, d as isDevelopment, f as isProduction, i as logger, l as getBooleanEnvVar, m as nodeENV, n as createLogger, o as getColorDepth, p as isTest, r as levels, s as ENV, t as TTY_COLORS, u as getEnvVar } from "../env-
|
|
1
|
+
import { a as shouldPublishLog, c as env, d as isDevelopment, f as isProduction, i as logger, l as getBooleanEnvVar, m as nodeENV, n as createLogger, o as getColorDepth, p as isTest, r as levels, s as ENV, t as TTY_COLORS, u as getEnvVar } from "../env-DwlNAN_D.mjs";
|
|
2
2
|
|
|
3
3
|
export { ENV, TTY_COLORS, createLogger, env, getBooleanEnvVar, getColorDepth, getEnvVar, isDevelopment, isProduction, isTest, levels, logger, nodeENV, shouldPublishLog };
|
package/dist/error/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../utils-
|
|
2
|
-
import { n as BASE_ERROR_CODES, t as BetterAuthError } from "../error-
|
|
1
|
+
import "../utils-C5EN75oV.mjs";
|
|
2
|
+
import { n as BASE_ERROR_CODES, t as BetterAuthError } from "../error-BhAKg8LX.mjs";
|
|
3
3
|
|
|
4
4
|
export { BASE_ERROR_CODES, BetterAuthError };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { i as Logger, o as createLogger } from "./index-
|
|
2
|
-
import * as better_call0 from "better-call";
|
|
3
|
-
import { CookieOptions, Endpoint, EndpointContext, EndpointOptions, InputContext, Middleware } from "better-call";
|
|
1
|
+
import { i as Logger, o as createLogger } from "./index-CdubV7uy.mjs";
|
|
4
2
|
import * as z from "zod";
|
|
5
3
|
import { BetterFetch, BetterFetchOption, BetterFetchPlugin } from "@better-fetch/fetch";
|
|
6
4
|
import * as jose0 from "jose";
|
|
5
|
+
import * as better_call0 from "better-call";
|
|
6
|
+
import { CookieOptions, Endpoint, EndpointContext, EndpointOptions, InputContext, Middleware } from "better-call";
|
|
7
7
|
import { StandardSchemaV1, StandardSchemaV1 as StandardSchemaV1$1 } from "@standard-schema/spec";
|
|
8
8
|
import { Database } from "bun:sqlite";
|
|
9
9
|
import { DatabaseSync } from "node:sqlite";
|
|
@@ -6424,6 +6424,7 @@ type BetterAuthOptions = {
|
|
|
6424
6424
|
* Send a verification email when the user changes their email.
|
|
6425
6425
|
* @param data the data object
|
|
6426
6426
|
* @param request the request object
|
|
6427
|
+
* @deprecated Use `sendChangeEmailConfirmation` instead
|
|
6427
6428
|
*/
|
|
6428
6429
|
sendChangeEmailVerification?: (data: {
|
|
6429
6430
|
user: User;
|
|
@@ -6431,6 +6432,22 @@ type BetterAuthOptions = {
|
|
|
6431
6432
|
url: string;
|
|
6432
6433
|
token: string;
|
|
6433
6434
|
}, request?: Request) => Promise<void>;
|
|
6435
|
+
/**
|
|
6436
|
+
* Send a confirmation email to the old email address when the user changes their email.
|
|
6437
|
+
* @param data the data object
|
|
6438
|
+
* @param request the request object
|
|
6439
|
+
*/
|
|
6440
|
+
sendChangeEmailConfirmation?: (data: {
|
|
6441
|
+
user: User;
|
|
6442
|
+
newEmail: string;
|
|
6443
|
+
url: string;
|
|
6444
|
+
token: string;
|
|
6445
|
+
}, request?: Request) => Promise<void>;
|
|
6446
|
+
/**
|
|
6447
|
+
* Update the email without verification if the user is not verified.
|
|
6448
|
+
* @default false
|
|
6449
|
+
*/
|
|
6450
|
+
updateEmailWithoutVerification?: boolean;
|
|
6434
6451
|
};
|
|
6435
6452
|
/**
|
|
6436
6453
|
* User deletion configuration
|
|
@@ -6715,12 +6732,7 @@ type BetterAuthOptions = {
|
|
|
6715
6732
|
/**
|
|
6716
6733
|
* Advanced options
|
|
6717
6734
|
*/
|
|
6718
|
-
advanced?:
|
|
6719
|
-
/**
|
|
6720
|
-
* @deprecated Please use `database.generateId` instead.
|
|
6721
|
-
*/
|
|
6722
|
-
generateId?: never;
|
|
6723
|
-
}) | undefined;
|
|
6735
|
+
advanced?: BetterAuthAdvancedOptions | undefined;
|
|
6724
6736
|
logger?: Logger | undefined;
|
|
6725
6737
|
/**
|
|
6726
6738
|
* allows you to define custom hooks that can be
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { En as BetterAuthCookies, Tn as LiteralUnion, _ as GenerateIdFn, c as BetterAuthClientPlugin, d as AuthContext, f as GenericEndpointContext, g as BetterAuthRateLimitOptions, h as BetterAuthOptions, l as ClientAtomListener, m as BetterAuthAdvancedOptions, o as StandardSchemaV1, p as InternalAdapter, s as BetterAuthClientOptions, u as ClientStore, v as BetterAuthPlugin, wn as LiteralString, y as HookEndpointContext } from "./index-
|
|
2
|
-
import "./index-
|
|
1
|
+
import { En as BetterAuthCookies, Tn as LiteralUnion, _ as GenerateIdFn, c as BetterAuthClientPlugin, d as AuthContext, f as GenericEndpointContext, g as BetterAuthRateLimitOptions, h as BetterAuthOptions, l as ClientAtomListener, m as BetterAuthAdvancedOptions, o as StandardSchemaV1, p as InternalAdapter, s as BetterAuthClientOptions, u as ClientStore, v as BetterAuthPlugin, wn as LiteralString, y as HookEndpointContext } from "./index-X4TpuzeM.mjs";
|
|
2
|
+
import "./index-CdubV7uy.mjs";
|
|
3
3
|
export { AuthContext, BetterAuthAdvancedOptions, BetterAuthClientOptions, BetterAuthClientPlugin, BetterAuthCookies, BetterAuthOptions, BetterAuthPlugin, BetterAuthRateLimitOptions, ClientAtomListener, ClientStore, GenerateIdFn, GenericEndpointContext, HookEndpointContext, InternalAdapter, LiteralString, LiteralUnion, StandardSchemaV1 };
|
package/dist/oauth2/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { An as generateCodeChallenge, Bn as ProviderOptions, Dn as createAuthorizationCodeRequest, Fn as clientCredentialsToken, In as createClientCredentialsTokenRequest, Ln as OAuth2Tokens, Mn as createRefreshAccessTokenRequest, Nn as refreshAccessToken, On as validateAuthorizationCode, Pn as createAuthorizationURL, Rn as OAuth2UserInfo, jn as getOAuth2Tokens, kn as validateToken, zn as OAuthProvider } from "../index-
|
|
2
|
-
import "../index-
|
|
1
|
+
import { An as generateCodeChallenge, Bn as ProviderOptions, Dn as createAuthorizationCodeRequest, Fn as clientCredentialsToken, In as createClientCredentialsTokenRequest, Ln as OAuth2Tokens, Mn as createRefreshAccessTokenRequest, Nn as refreshAccessToken, On as validateAuthorizationCode, Pn as createAuthorizationURL, Rn as OAuth2UserInfo, jn as getOAuth2Tokens, kn as validateToken, zn as OAuthProvider } from "../index-X4TpuzeM.mjs";
|
|
2
|
+
import "../index-CdubV7uy.mjs";
|
|
3
3
|
export { OAuth2Tokens, OAuth2UserInfo, OAuthProvider, ProviderOptions, clientCredentialsToken, createAuthorizationCodeRequest, createAuthorizationURL, createClientCredentialsTokenRequest, createRefreshAccessTokenRequest, generateCodeChallenge, getOAuth2Tokens, refreshAccessToken, validateAuthorizationCode, validateToken };
|
package/dist/oauth2/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as refreshAccessToken, c as getOAuth2Tokens, i as createRefreshAccessTokenRequest, l as clientCredentialsToken, n as validateAuthorizationCode, o as createAuthorizationURL, r as validateToken, s as generateCodeChallenge, t as createAuthorizationCodeRequest, u as createClientCredentialsTokenRequest } from "../oauth2-
|
|
1
|
+
import { a as refreshAccessToken, c as getOAuth2Tokens, i as createRefreshAccessTokenRequest, l as clientCredentialsToken, n as validateAuthorizationCode, o as createAuthorizationURL, r as validateToken, s as generateCodeChallenge, t as createAuthorizationCodeRequest, u as createClientCredentialsTokenRequest } from "../oauth2-D3aE32ZH.mjs";
|
|
2
2
|
|
|
3
3
|
export { clientCredentialsToken, createAuthorizationCodeRequest, createAuthorizationURL, createClientCredentialsTokenRequest, createRefreshAccessTokenRequest, generateCodeChallenge, getOAuth2Tokens, refreshAccessToken, validateAuthorizationCode, validateToken };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as ZoomOptions, $t as microsoft, A as PayPalProfile, At as DropboxOptions, B as NaverOptions, Bt as SpotifyProfile, C as SocialProviders, Cn as getApplePublicKey, Ct as LinearOptions, D as PolarProfile, Dt as KickOptions, E as PolarOptions, Et as linear, F as paybin, Ft as twitter, G as kakao, Gt as HuggingFaceOptions, H as naver, Ht as SlackOptions, I as LineIdTokenPayload, It as TwitchOptions, J as notion, Jt as GoogleOptions, K as NotionOptions, Kt as HuggingFaceProfile, L as LineOptions, Lt as TwitchProfile, M as paypal, Mt as dropbox, N as PaybinOptions, Nt as TwitterOption, O as polar, Ot as KickProfile, P as PaybinProfile, Pt as TwitterProfile, Q as PronounOption, Qt as MicrosoftOptions, R as LineUserInfo, Rt as twitch, S as SocialProviderListEnum, Sn as apple, St as linkedin, T as socialProviders, Tt as LinearUser, U as KakaoOptions, Ut as SlackProfile, V as NaverProfile, Vt as spotify, W as KakaoProfile, Wt as slack, X as LoginType, Xt as google, Y as AccountStatus, Yt as GoogleProfile, Z as PhoneNumber, Zt as MicrosoftEntraIDProfile, _n as AtlassianProfile, _t as GitlabOptions, an as figma, at as SalesforceOptions, b as SocialProvider, bn as AppleOptions, bt as LinkedInOptions, cn as facebook, ct as RobloxOptions, dn as discord, dt as RedditOptions, en as GithubOptions, et as ZoomProfile, fn as CognitoOptions, ft as RedditProfile, gn as AtlassianOptions, gt as tiktok, hn as getCognitoPublicKey, ht as TiktokProfile, in as FigmaProfile, it as vk, j as PayPalTokenResponse, jt as DropboxProfile, k as PayPalOptions, kt as kick, ln as DiscordOptions, lt as RobloxProfile, mn as cognito, mt as TiktokOptions, nn as github, nt as VkOption, on as FacebookOptions, ot as SalesforceProfile, pn as CognitoProfile, pt as reddit, q as NotionProfile, qt as huggingface, rn as FigmaOptions, rt as VkProfile, sn as FacebookProfile, st as salesforce, tn as GithubProfile, tt as zoom, un as DiscordProfile, ut as roblox, vn as atlassian, vt as GitlabProfile, w as socialProviderList, wt as LinearProfile, x as SocialProviderList, xn as AppleProfile, xt as LinkedInProfile, yn as AppleNonConformUser, yt as gitlab, z as line, zt as SpotifyOptions } from "../index-
|
|
2
|
-
import "../index-
|
|
1
|
+
import { $ as ZoomOptions, $t as microsoft, A as PayPalProfile, At as DropboxOptions, B as NaverOptions, Bt as SpotifyProfile, C as SocialProviders, Cn as getApplePublicKey, Ct as LinearOptions, D as PolarProfile, Dt as KickOptions, E as PolarOptions, Et as linear, F as paybin, Ft as twitter, G as kakao, Gt as HuggingFaceOptions, H as naver, Ht as SlackOptions, I as LineIdTokenPayload, It as TwitchOptions, J as notion, Jt as GoogleOptions, K as NotionOptions, Kt as HuggingFaceProfile, L as LineOptions, Lt as TwitchProfile, M as paypal, Mt as dropbox, N as PaybinOptions, Nt as TwitterOption, O as polar, Ot as KickProfile, P as PaybinProfile, Pt as TwitterProfile, Q as PronounOption, Qt as MicrosoftOptions, R as LineUserInfo, Rt as twitch, S as SocialProviderListEnum, Sn as apple, St as linkedin, T as socialProviders, Tt as LinearUser, U as KakaoOptions, Ut as SlackProfile, V as NaverProfile, Vt as spotify, W as KakaoProfile, Wt as slack, X as LoginType, Xt as google, Y as AccountStatus, Yt as GoogleProfile, Z as PhoneNumber, Zt as MicrosoftEntraIDProfile, _n as AtlassianProfile, _t as GitlabOptions, an as figma, at as SalesforceOptions, b as SocialProvider, bn as AppleOptions, bt as LinkedInOptions, cn as facebook, ct as RobloxOptions, dn as discord, dt as RedditOptions, en as GithubOptions, et as ZoomProfile, fn as CognitoOptions, ft as RedditProfile, gn as AtlassianOptions, gt as tiktok, hn as getCognitoPublicKey, ht as TiktokProfile, in as FigmaProfile, it as vk, j as PayPalTokenResponse, jt as DropboxProfile, k as PayPalOptions, kt as kick, ln as DiscordOptions, lt as RobloxProfile, mn as cognito, mt as TiktokOptions, nn as github, nt as VkOption, on as FacebookOptions, ot as SalesforceProfile, pn as CognitoProfile, pt as reddit, q as NotionProfile, qt as huggingface, rn as FigmaOptions, rt as VkProfile, sn as FacebookProfile, st as salesforce, tn as GithubProfile, tt as zoom, un as DiscordProfile, ut as roblox, vn as atlassian, vt as GitlabProfile, w as socialProviderList, wt as LinearProfile, x as SocialProviderList, xn as AppleProfile, xt as LinkedInProfile, yn as AppleNonConformUser, yt as gitlab, z as line, zt as SpotifyOptions } from "../index-X4TpuzeM.mjs";
|
|
2
|
+
import "../index-CdubV7uy.mjs";
|
|
3
3
|
export { AccountStatus, AppleNonConformUser, AppleOptions, AppleProfile, AtlassianOptions, AtlassianProfile, CognitoOptions, CognitoProfile, DiscordOptions, DiscordProfile, DropboxOptions, DropboxProfile, FacebookOptions, FacebookProfile, FigmaOptions, FigmaProfile, GithubOptions, GithubProfile, GitlabOptions, GitlabProfile, GoogleOptions, GoogleProfile, HuggingFaceOptions, HuggingFaceProfile, KakaoOptions, KakaoProfile, KickOptions, KickProfile, LineIdTokenPayload, LineOptions, LineUserInfo, LinearOptions, LinearProfile, LinearUser, LinkedInOptions, LinkedInProfile, LoginType, MicrosoftEntraIDProfile, MicrosoftOptions, NaverOptions, NaverProfile, NotionOptions, NotionProfile, PayPalOptions, PayPalProfile, PayPalTokenResponse, PaybinOptions, PaybinProfile, PhoneNumber, PolarOptions, PolarProfile, PronounOption, RedditOptions, RedditProfile, RobloxOptions, RobloxProfile, SalesforceOptions, SalesforceProfile, SlackOptions, SlackProfile, SocialProvider, SocialProviderList, SocialProviderListEnum, SocialProviders, SpotifyOptions, SpotifyProfile, TiktokOptions, TiktokProfile, TwitchOptions, TwitchProfile, TwitterOption, TwitterProfile, VkOption, VkProfile, ZoomOptions, ZoomProfile, apple, atlassian, cognito, discord, dropbox, facebook, figma, getApplePublicKey, getCognitoPublicKey, github, gitlab, google, huggingface, kakao, kick, line, linear, linkedin, microsoft, naver, notion, paybin, paypal, polar, reddit, roblox, salesforce, slack, socialProviderList, socialProviders, spotify, tiktok, twitch, twitter, vk, zoom };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { i as logger } from "../env-
|
|
2
|
-
import "../
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { APIError } from "better-call";
|
|
1
|
+
import { i as logger } from "../env-DwlNAN_D.mjs";
|
|
2
|
+
import { a as refreshAccessToken, c as getOAuth2Tokens, n as validateAuthorizationCode, o as createAuthorizationURL, s as generateCodeChallenge } from "../oauth2-D3aE32ZH.mjs";
|
|
3
|
+
import "../utils-C5EN75oV.mjs";
|
|
4
|
+
import { t as BetterAuthError } from "../error-BhAKg8LX.mjs";
|
|
6
5
|
import * as z from "zod";
|
|
7
6
|
import { base64 } from "@better-auth/utils/base64";
|
|
8
7
|
import { betterFetch } from "@better-fetch/fetch";
|
|
9
8
|
import { createRemoteJWKSet, decodeJwt, decodeProtectedHeader, importJWK, jwtVerify } from "jose";
|
|
9
|
+
import { APIError } from "better-call";
|
|
10
10
|
|
|
11
11
|
//#region src/social-providers/apple.ts
|
|
12
12
|
const apple = (options) => {
|
package/dist/utils/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/core",
|
|
3
|
-
"version": "1.4.0-beta.
|
|
3
|
+
"version": "1.4.0-beta.23",
|
|
4
4
|
"description": "The most comprehensive authentication framework for TypeScript.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"@better-auth/utils": "0.3.0",
|
|
104
104
|
"@better-fetch/fetch": "1.1.18",
|
|
105
105
|
"@types/better-sqlite3": "^7.6.13",
|
|
106
|
-
"better-call": "1.0.
|
|
106
|
+
"better-call": "1.0.28",
|
|
107
107
|
"better-sqlite3": "^12.4.1",
|
|
108
108
|
"jose": "^6.1.0",
|
|
109
109
|
"kysely": "^0.28.5",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"peerDependencies": {
|
|
118
118
|
"@better-auth/utils": "0.3.0",
|
|
119
119
|
"@better-fetch/fetch": "1.1.18",
|
|
120
|
-
"better-call": "1.0.
|
|
120
|
+
"better-call": "1.0.28",
|
|
121
121
|
"jose": "^6.1.0",
|
|
122
122
|
"kysely": "^0.28.5",
|
|
123
123
|
"nanostores": "^1.0.1"
|
package/src/api/index.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
createMiddleware,
|
|
4
|
-
type EndpointContext,
|
|
5
|
-
type EndpointOptions,
|
|
6
|
-
} from "better-call";
|
|
1
|
+
import type { EndpointContext, EndpointOptions } from "better-call";
|
|
2
|
+
import { createEndpoint, createMiddleware } from "better-call";
|
|
7
3
|
import { runWithEndpointContext } from "../context";
|
|
8
4
|
import type { AuthContext } from "../types";
|
|
9
5
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { EndpointContext, InputContext } from "better-call";
|
|
2
|
-
import {
|
|
2
|
+
import type { AsyncLocalStorage } from "../async_hooks";
|
|
3
|
+
import { getAsyncLocalStorage } from "../async_hooks";
|
|
3
4
|
import type { AuthContext } from "../types";
|
|
4
5
|
|
|
5
6
|
export type AuthEndpointContext = Partial<
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
+
import type { RequestStateWeakMap } from "./request-state";
|
|
2
3
|
import {
|
|
3
4
|
defineRequestState,
|
|
4
5
|
getCurrentRequestState,
|
|
5
6
|
hasRequestState,
|
|
6
|
-
type RequestStateWeakMap,
|
|
7
7
|
runWithRequestState,
|
|
8
8
|
} from "./request-state";
|
|
9
9
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { AsyncLocalStorage } from "../async_hooks";
|
|
2
|
+
import { getAsyncLocalStorage } from "../async_hooks";
|
|
2
3
|
import type { DBAdapter, DBTransactionAdapter } from "../db/adapter";
|
|
3
4
|
|
|
4
5
|
let currentAdapterAsyncStorage: AsyncLocalStorage<DBTransactionAdapter> | null =
|
package/src/env/logger.test.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { betterFetch } from "@better-fetch/fetch";
|
|
2
|
+
import type { OAuthProvider, ProviderOptions } from "../oauth2";
|
|
2
3
|
import {
|
|
3
4
|
createAuthorizationURL,
|
|
4
|
-
type OAuthProvider,
|
|
5
|
-
type ProviderOptions,
|
|
6
5
|
refreshAccessToken,
|
|
7
6
|
validateAuthorizationCode,
|
|
8
7
|
} from "../oauth2";
|
package/src/types/context.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
Verification,
|
|
10
10
|
} from "../db";
|
|
11
11
|
import type { DBAdapter, Where } from "../db/adapter";
|
|
12
|
-
import { createLogger } from "../env";
|
|
12
|
+
import type { createLogger } from "../env";
|
|
13
13
|
import type { OAuthProvider } from "../oauth2";
|
|
14
14
|
import type { BetterAuthCookies } from "./cookie";
|
|
15
15
|
import type { LiteralUnion } from "./helper";
|
|
@@ -617,6 +617,7 @@ export type BetterAuthOptions = {
|
|
|
617
617
|
* Send a verification email when the user changes their email.
|
|
618
618
|
* @param data the data object
|
|
619
619
|
* @param request the request object
|
|
620
|
+
* @deprecated Use `sendChangeEmailConfirmation` instead
|
|
620
621
|
*/
|
|
621
622
|
sendChangeEmailVerification?: (
|
|
622
623
|
data: {
|
|
@@ -627,6 +628,25 @@ export type BetterAuthOptions = {
|
|
|
627
628
|
},
|
|
628
629
|
request?: Request,
|
|
629
630
|
) => Promise<void>;
|
|
631
|
+
/**
|
|
632
|
+
* Send a confirmation email to the old email address when the user changes their email.
|
|
633
|
+
* @param data the data object
|
|
634
|
+
* @param request the request object
|
|
635
|
+
*/
|
|
636
|
+
sendChangeEmailConfirmation?: (
|
|
637
|
+
data: {
|
|
638
|
+
user: User;
|
|
639
|
+
newEmail: string;
|
|
640
|
+
url: string;
|
|
641
|
+
token: string;
|
|
642
|
+
},
|
|
643
|
+
request?: Request,
|
|
644
|
+
) => Promise<void>;
|
|
645
|
+
/**
|
|
646
|
+
* Update the email without verification if the user is not verified.
|
|
647
|
+
* @default false
|
|
648
|
+
*/
|
|
649
|
+
updateEmailWithoutVerification?: boolean;
|
|
630
650
|
};
|
|
631
651
|
/**
|
|
632
652
|
* User deletion configuration
|
|
@@ -936,14 +956,7 @@ export type BetterAuthOptions = {
|
|
|
936
956
|
/**
|
|
937
957
|
* Advanced options
|
|
938
958
|
*/
|
|
939
|
-
advanced?:
|
|
940
|
-
| (BetterAuthAdvancedOptions & {
|
|
941
|
-
/**
|
|
942
|
-
* @deprecated Please use `database.generateId` instead.
|
|
943
|
-
*/
|
|
944
|
-
generateId?: never;
|
|
945
|
-
})
|
|
946
|
-
| undefined;
|
|
959
|
+
advanced?: BetterAuthAdvancedOptions | undefined;
|
|
947
960
|
logger?: Logger | undefined;
|
|
948
961
|
/**
|
|
949
962
|
* allows you to define custom hooks that can be
|
package/vitest.config.ts
ADDED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|