better-auth 1.2.5-beta.9 → 1.2.6-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/drizzle-adapter/index.d.cts +3 -3
- package/dist/adapters/drizzle-adapter/index.d.mts +3 -3
- package/dist/adapters/drizzle-adapter/index.d.ts +3 -3
- package/dist/adapters/kysely-adapter/index.d.cts +3 -3
- package/dist/adapters/kysely-adapter/index.d.mts +3 -3
- package/dist/adapters/kysely-adapter/index.d.ts +3 -3
- package/dist/adapters/memory-adapter/index.d.cts +3 -3
- package/dist/adapters/memory-adapter/index.d.mts +3 -3
- package/dist/adapters/memory-adapter/index.d.ts +3 -3
- package/dist/adapters/mongodb-adapter/index.d.cts +3 -3
- package/dist/adapters/mongodb-adapter/index.d.mts +3 -3
- package/dist/adapters/mongodb-adapter/index.d.ts +3 -3
- package/dist/adapters/prisma-adapter/index.d.cts +3 -3
- package/dist/adapters/prisma-adapter/index.d.mts +3 -3
- package/dist/adapters/prisma-adapter/index.d.ts +3 -3
- package/dist/adapters/test.d.cts +3 -3
- package/dist/adapters/test.d.mts +3 -3
- package/dist/adapters/test.d.ts +3 -3
- package/dist/api/index.cjs +77 -75
- package/dist/api/index.d.cts +4 -4
- package/dist/api/index.d.mts +4 -4
- package/dist/api/index.d.ts +4 -4
- package/dist/api/index.mjs +6 -5
- package/dist/client/index.d.cts +4 -4
- package/dist/client/index.d.mts +4 -4
- package/dist/client/index.d.ts +4 -4
- package/dist/client/plugins/index.d.cts +4 -4
- package/dist/client/plugins/index.d.mts +4 -4
- package/dist/client/plugins/index.d.ts +4 -4
- package/dist/client/react/index.d.cts +4 -4
- package/dist/client/react/index.d.mts +4 -4
- package/dist/client/react/index.d.ts +4 -4
- package/dist/client/solid/index.d.cts +4 -4
- package/dist/client/solid/index.d.mts +4 -4
- package/dist/client/solid/index.d.ts +4 -4
- package/dist/client/svelte/index.d.cts +4 -4
- package/dist/client/svelte/index.d.mts +4 -4
- package/dist/client/svelte/index.d.ts +4 -4
- package/dist/client/vue/index.d.cts +4 -4
- package/dist/client/vue/index.d.mts +4 -4
- package/dist/client/vue/index.d.ts +4 -4
- package/dist/cookies/index.d.cts +3 -3
- package/dist/cookies/index.d.mts +3 -3
- package/dist/cookies/index.d.ts +3 -3
- package/dist/db/index.cjs +1 -1
- package/dist/db/index.d.cts +4 -4
- package/dist/db/index.d.mts +4 -4
- package/dist/db/index.d.ts +4 -4
- package/dist/db/index.mjs +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +4 -4
- package/dist/integrations/next-js.cjs +5 -5
- package/dist/integrations/next-js.d.cts +3 -3
- package/dist/integrations/next-js.d.mts +3 -3
- package/dist/integrations/next-js.d.ts +3 -3
- package/dist/integrations/next-js.mjs +4 -4
- package/dist/integrations/node.d.cts +3 -3
- package/dist/integrations/node.d.mts +3 -3
- package/dist/integrations/node.d.ts +3 -3
- package/dist/integrations/svelte-kit.d.cts +3 -3
- package/dist/integrations/svelte-kit.d.mts +3 -3
- package/dist/integrations/svelte-kit.d.ts +3 -3
- package/dist/oauth2/index.cjs +7 -6
- package/dist/oauth2/index.d.cts +14 -5
- package/dist/oauth2/index.d.mts +14 -5
- package/dist/oauth2/index.d.ts +14 -5
- package/dist/oauth2/index.mjs +1 -1
- package/dist/plugins/admin/index.cjs +3 -3
- package/dist/plugins/admin/index.d.cts +3 -3
- package/dist/plugins/admin/index.d.mts +3 -3
- package/dist/plugins/admin/index.d.ts +3 -3
- package/dist/plugins/admin/index.mjs +3 -3
- package/dist/plugins/anonymous/index.cjs +5 -5
- package/dist/plugins/anonymous/index.d.cts +3 -3
- package/dist/plugins/anonymous/index.d.mts +3 -3
- package/dist/plugins/anonymous/index.d.ts +3 -3
- package/dist/plugins/anonymous/index.mjs +2 -2
- package/dist/plugins/bearer/index.cjs +4 -4
- package/dist/plugins/bearer/index.d.cts +3 -3
- package/dist/plugins/bearer/index.d.mts +3 -3
- package/dist/plugins/bearer/index.d.ts +3 -3
- package/dist/plugins/bearer/index.mjs +2 -2
- package/dist/plugins/custom-session/index.cjs +4 -4
- package/dist/plugins/custom-session/index.d.cts +3 -3
- package/dist/plugins/custom-session/index.d.mts +3 -3
- package/dist/plugins/custom-session/index.d.ts +3 -3
- package/dist/plugins/custom-session/index.mjs +2 -2
- package/dist/plugins/email-otp/index.cjs +10 -10
- package/dist/plugins/email-otp/index.d.cts +3 -3
- package/dist/plugins/email-otp/index.d.mts +3 -3
- package/dist/plugins/email-otp/index.d.ts +3 -3
- package/dist/plugins/email-otp/index.mjs +2 -2
- package/dist/plugins/generic-oauth/index.cjs +43 -19
- package/dist/plugins/generic-oauth/index.d.cts +4 -4
- package/dist/plugins/generic-oauth/index.d.mts +4 -4
- package/dist/plugins/generic-oauth/index.d.ts +4 -4
- package/dist/plugins/generic-oauth/index.mjs +29 -5
- package/dist/plugins/index.cjs +22 -22
- package/dist/plugins/index.d.cts +4 -4
- package/dist/plugins/index.d.mts +4 -4
- package/dist/plugins/index.d.ts +4 -4
- package/dist/plugins/index.mjs +6 -6
- package/dist/plugins/jwt/index.cjs +6 -6
- package/dist/plugins/jwt/index.d.cts +3 -3
- package/dist/plugins/jwt/index.d.mts +3 -3
- package/dist/plugins/jwt/index.d.ts +3 -3
- package/dist/plugins/jwt/index.mjs +2 -2
- package/dist/plugins/magic-link/index.cjs +6 -6
- package/dist/plugins/magic-link/index.mjs +2 -2
- package/dist/plugins/multi-session/index.cjs +9 -9
- package/dist/plugins/multi-session/index.d.cts +3 -3
- package/dist/plugins/multi-session/index.d.mts +3 -3
- package/dist/plugins/multi-session/index.d.ts +3 -3
- package/dist/plugins/multi-session/index.mjs +2 -2
- package/dist/plugins/oauth-proxy/index.cjs +6 -6
- package/dist/plugins/oauth-proxy/index.d.cts +3 -3
- package/dist/plugins/oauth-proxy/index.d.mts +3 -3
- package/dist/plugins/oauth-proxy/index.d.ts +3 -3
- package/dist/plugins/oauth-proxy/index.mjs +2 -2
- package/dist/plugins/oidc-provider/index.cjs +14 -14
- package/dist/plugins/oidc-provider/index.d.cts +3 -3
- package/dist/plugins/oidc-provider/index.d.mts +3 -3
- package/dist/plugins/oidc-provider/index.d.ts +3 -3
- package/dist/plugins/oidc-provider/index.mjs +2 -2
- package/dist/plugins/one-tap/index.cjs +3 -3
- package/dist/plugins/one-tap/index.mjs +2 -2
- package/dist/plugins/open-api/index.cjs +4 -4
- package/dist/plugins/open-api/index.d.cts +3 -3
- package/dist/plugins/open-api/index.d.mts +3 -3
- package/dist/plugins/open-api/index.d.ts +3 -3
- package/dist/plugins/open-api/index.mjs +2 -2
- package/dist/plugins/organization/index.cjs +3 -3
- package/dist/plugins/organization/index.d.cts +3 -3
- package/dist/plugins/organization/index.d.mts +3 -3
- package/dist/plugins/organization/index.d.ts +3 -3
- package/dist/plugins/organization/index.mjs +3 -3
- package/dist/plugins/passkey/index.cjs +15 -15
- package/dist/plugins/passkey/index.d.cts +3 -3
- package/dist/plugins/passkey/index.d.mts +3 -3
- package/dist/plugins/passkey/index.d.ts +3 -3
- package/dist/plugins/passkey/index.mjs +2 -2
- package/dist/plugins/phone-number/index.cjs +13 -13
- package/dist/plugins/phone-number/index.d.cts +3 -3
- package/dist/plugins/phone-number/index.d.mts +3 -3
- package/dist/plugins/phone-number/index.d.ts +3 -3
- package/dist/plugins/phone-number/index.mjs +2 -2
- package/dist/plugins/sso/index.cjs +11 -11
- package/dist/plugins/sso/index.d.cts +2 -2
- package/dist/plugins/sso/index.d.mts +2 -2
- package/dist/plugins/sso/index.d.ts +2 -2
- package/dist/plugins/sso/index.mjs +3 -3
- package/dist/plugins/two-factor/index.cjs +20 -20
- package/dist/plugins/two-factor/index.d.cts +3 -3
- package/dist/plugins/two-factor/index.d.mts +3 -3
- package/dist/plugins/two-factor/index.d.ts +3 -3
- package/dist/plugins/two-factor/index.mjs +3 -3
- package/dist/plugins/username/index.cjs +9 -9
- package/dist/plugins/username/index.d.cts +3 -3
- package/dist/plugins/username/index.d.mts +3 -3
- package/dist/plugins/username/index.d.ts +3 -3
- package/dist/plugins/username/index.mjs +2 -2
- package/dist/shared/{better-auth.oyDBIJLs.mjs → better-auth.2rfXmCNS.mjs} +1 -1
- package/dist/shared/{better-auth.KTt7CS7L.mjs → better-auth.9knM1kR4.mjs} +1 -1
- package/dist/shared/{better-auth.DiMBK1Ep.mjs → better-auth.B2THyVQH.mjs} +54 -1
- package/dist/shared/{better-auth.C8tekzhG.cjs → better-auth.B7irTavj.cjs} +35 -35
- package/dist/shared/{better-auth.Dd96RDNl.d.ts → better-auth.BAfIsot3.d.ts} +41 -2
- package/dist/shared/{better-auth.Dunt9jpN.d.cts → better-auth.BBG0jAhH.d.mts} +2 -2
- package/dist/shared/{better-auth.CxMUffeh.d.cts → better-auth.BDAwKjlL.d.cts} +567 -46
- package/dist/shared/{better-auth.CbBX7Xla.mjs → better-auth.BK4Kh5QZ.mjs} +19 -17
- package/dist/shared/{better-auth.DgXCgiHI.cjs → better-auth.BLV8UOn8.cjs} +54 -0
- package/dist/shared/{better-auth.BjoUuJNr.d.mts → better-auth.BTnAiI8e.d.mts} +41 -2
- package/dist/shared/{better-auth.CzK7QJBv.d.cts → better-auth.CH6fRG6d.d.cts} +41 -2
- package/dist/shared/{better-auth.dzwyqpra.d.mts → better-auth.CTQDLJN7.d.mts} +567 -46
- package/dist/shared/{better-auth.CEuqoYDM.d.mts → better-auth.CtSY9Kmu.d.cts} +2 -2
- package/dist/shared/{better-auth.Cz2saE_0.d.cts → better-auth.DAnkIG1r.d.cts} +1 -1
- package/dist/shared/{better-auth.4ZqMps6Z.d.ts → better-auth.DCxEy-As.d.ts} +1 -1
- package/dist/shared/{better-auth.D7hUw1_Y.d.ts → better-auth.DIOWNBS2.d.ts} +1 -1
- package/dist/shared/{better-auth.ybwxmbrM.mjs → better-auth.DQ-pFMwp.mjs} +118 -5
- package/dist/shared/{better-auth.BxC2ipUB.d.mts → better-auth.DZPJQ81N.d.mts} +1 -1
- package/dist/shared/{better-auth.CL_N_Cfq.cjs → better-auth.DqGx7Ip8.cjs} +20 -20
- package/dist/shared/{better-auth.wspQErD2.cjs → better-auth.TNTVT6jt.cjs} +3 -3
- package/dist/shared/{better-auth.4J4_zAGP.cjs → better-auth.b0MLzqQX.cjs} +118 -4
- package/dist/shared/{better-auth.CdPDif0r.mjs → better-auth.cN4sTcuQ.mjs} +1 -1
- package/dist/shared/{better-auth.X0ynzeu1.cjs → better-auth.q7ChvjiM.cjs} +19 -17
- package/dist/shared/{better-auth.CixnJ90x.d.ts → better-auth.tpz8D0AA.d.ts} +567 -46
- package/dist/social-providers/index.cjs +197 -32
- package/dist/social-providers/index.d.cts +1 -1
- package/dist/social-providers/index.d.mts +1 -1
- package/dist/social-providers/index.d.ts +1 -1
- package/dist/social-providers/index.mjs +166 -1
- package/dist/types/index.d.cts +4 -4
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.d.ts +4 -4
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const api_index = require('./api/index.cjs');
|
|
4
4
|
const defu = require('defu');
|
|
5
5
|
const password = require('./shared/better-auth.YUF6P-PB.cjs');
|
|
6
|
-
const getMigration = require('./shared/better-auth.
|
|
6
|
+
const getMigration = require('./shared/better-auth.q7ChvjiM.cjs');
|
|
7
7
|
const getTables = require('./shared/better-auth.BEphVDyL.cjs');
|
|
8
8
|
require('zod');
|
|
9
9
|
require('./shared/better-auth.C5H9XEzZ.cjs');
|
|
@@ -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.C-R0J0n1.cjs');
|
|
25
25
|
const index = require('./shared/better-auth.ANpbi45u.cjs');
|
|
26
|
-
const
|
|
26
|
+
const refreshToken = require('./shared/better-auth.b0MLzqQX.cjs');
|
|
27
27
|
const misc = require('./shared/better-auth.BLDOwz3i.cjs');
|
|
28
28
|
const state = require('./shared/better-auth.QbbyHMYf.cjs');
|
|
29
29
|
require('./shared/better-auth.i9-25Ul9.cjs');
|
|
@@ -40,7 +40,7 @@ require('./shared/better-auth.CUdxApHl.cjs');
|
|
|
40
40
|
require('./shared/better-auth.DWHWPllD.cjs');
|
|
41
41
|
require('@better-auth/utils/hmac');
|
|
42
42
|
require('@better-fetch/fetch');
|
|
43
|
-
require('./shared/better-auth.
|
|
43
|
+
require('./shared/better-auth.BLV8UOn8.cjs');
|
|
44
44
|
require('./shared/better-auth.BMYo0QR-.cjs');
|
|
45
45
|
require('jose/errors');
|
|
46
46
|
require('@better-auth/utils/binary');
|
|
@@ -246,7 +246,7 @@ const betterAuth = (options) => {
|
|
|
246
246
|
$Infer: {},
|
|
247
247
|
$ERROR_CODES: {
|
|
248
248
|
...errorCodes,
|
|
249
|
-
...
|
|
249
|
+
...refreshToken.BASE_ERROR_CODES
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
252
|
};
|
|
@@ -258,7 +258,7 @@ exports.shouldPublishLog = logger.shouldPublishLog;
|
|
|
258
258
|
exports.generateId = id.generateId;
|
|
259
259
|
exports.BetterAuthError = index.BetterAuthError;
|
|
260
260
|
exports.MissingDependencyError = index.MissingDependencyError;
|
|
261
|
-
exports.HIDE_METADATA =
|
|
261
|
+
exports.HIDE_METADATA = refreshToken.HIDE_METADATA;
|
|
262
262
|
exports.capitalizeFirstLetter = misc.capitalizeFirstLetter;
|
|
263
263
|
exports.generateState = state.generateState;
|
|
264
264
|
exports.parseState = state.parseState;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { u as Account, g as Adapter, x as AdapterInstance, w as AdapterSchemaCreation, r as AdditionalSessionFieldsInput, s as AdditionalSessionFieldsOutput, p as AdditionalUserFieldsInput, q as AdditionalUserFieldsOutput, i as Auth, l as AuthContext, A as AuthPluginSchema, f as BetterAuthOptions, B as BetterAuthPlugin, z as FilterActions, F as FilteredAPI, G as GenericEndpointContext, H as HookEndpointContext, D as InferAPI, I as InferOptionSchema, a as InferPluginErrorCodes, t as InferPluginTypes, k as InferSession, C as InferSessionAPI, j as InferUser, O as LogHandlerParams, L as LogLevel, N as Logger, M as Models, R as RateLimit, y as SecondaryStorage, S as Session, U as User, V as Verification, W as Where, m as WithJsDoc, n as betterAuth, P as createLogger, v as init, E as levels, Q as logger, J as shouldPublishLog } from './shared/better-auth.
|
|
1
|
+
export { u as Account, g as Adapter, x as AdapterInstance, w as AdapterSchemaCreation, r as AdditionalSessionFieldsInput, s as AdditionalSessionFieldsOutput, p as AdditionalUserFieldsInput, q as AdditionalUserFieldsOutput, i as Auth, l as AuthContext, A as AuthPluginSchema, f as BetterAuthOptions, B as BetterAuthPlugin, z as FilterActions, F as FilteredAPI, G as GenericEndpointContext, H as HookEndpointContext, D as InferAPI, I as InferOptionSchema, a as InferPluginErrorCodes, t as InferPluginTypes, k as InferSession, C as InferSessionAPI, j as InferUser, O as LogHandlerParams, L as LogLevel, N as Logger, M as Models, R as RateLimit, y as SecondaryStorage, S as Session, U as User, V as Verification, W as Where, m as WithJsDoc, n as betterAuth, P as createLogger, v as init, E as levels, Q as logger, J as shouldPublishLog } from './shared/better-auth.BDAwKjlL.cjs';
|
|
2
2
|
export { AtomListener, BetterAuthClientPlugin, ClientOptions, InferActions, InferAdditionalFromClient, InferClientAPI, InferErrorCodes, InferPluginsFromClient, InferSessionFromClient, InferUserFromClient, IsSignal, Store } from './types/index.cjs';
|
|
3
3
|
export { H as HIDE_METADATA } from './shared/better-auth.DEHJp1rk.cjs';
|
|
4
|
-
export { g as generateState, p as parseState } from './shared/better-auth.
|
|
4
|
+
export { g as generateState, p as parseState } from './shared/better-auth.DAnkIG1r.cjs';
|
|
5
5
|
export * from 'better-call';
|
|
6
6
|
export * from 'zod';
|
|
7
7
|
export { D as DeepPartial, E as Expand, H as HasRequiredKeys, a as LiteralNumber, L as LiteralString, d as LiteralUnion, O as OmitId, c as PreserveJSDoc, b as Prettify, P as PrettifyDeep, R as RequiredKeysOf, S as StripEmptyObjects, U as UnionToIntersection, W as WithoutEmpty } from './shared/better-auth.Bi8FQwDD.cjs';
|
|
8
|
-
import '
|
|
9
|
-
import './shared/better-auth.CzK7QJBv.cjs';
|
|
8
|
+
import './shared/better-auth.CH6fRG6d.cjs';
|
|
10
9
|
import 'jose';
|
|
10
|
+
import 'kysely';
|
|
11
11
|
import 'better-sqlite3';
|
|
12
12
|
import '@better-fetch/fetch';
|
|
13
13
|
import 'nanostores';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { u as Account, g as Adapter, x as AdapterInstance, w as AdapterSchemaCreation, r as AdditionalSessionFieldsInput, s as AdditionalSessionFieldsOutput, p as AdditionalUserFieldsInput, q as AdditionalUserFieldsOutput, i as Auth, l as AuthContext, A as AuthPluginSchema, f as BetterAuthOptions, B as BetterAuthPlugin, z as FilterActions, F as FilteredAPI, G as GenericEndpointContext, H as HookEndpointContext, D as InferAPI, I as InferOptionSchema, a as InferPluginErrorCodes, t as InferPluginTypes, k as InferSession, C as InferSessionAPI, j as InferUser, O as LogHandlerParams, L as LogLevel, N as Logger, M as Models, R as RateLimit, y as SecondaryStorage, S as Session, U as User, V as Verification, W as Where, m as WithJsDoc, n as betterAuth, P as createLogger, v as init, E as levels, Q as logger, J as shouldPublishLog } from './shared/better-auth.
|
|
1
|
+
export { u as Account, g as Adapter, x as AdapterInstance, w as AdapterSchemaCreation, r as AdditionalSessionFieldsInput, s as AdditionalSessionFieldsOutput, p as AdditionalUserFieldsInput, q as AdditionalUserFieldsOutput, i as Auth, l as AuthContext, A as AuthPluginSchema, f as BetterAuthOptions, B as BetterAuthPlugin, z as FilterActions, F as FilteredAPI, G as GenericEndpointContext, H as HookEndpointContext, D as InferAPI, I as InferOptionSchema, a as InferPluginErrorCodes, t as InferPluginTypes, k as InferSession, C as InferSessionAPI, j as InferUser, O as LogHandlerParams, L as LogLevel, N as Logger, M as Models, R as RateLimit, y as SecondaryStorage, S as Session, U as User, V as Verification, W as Where, m as WithJsDoc, n as betterAuth, P as createLogger, v as init, E as levels, Q as logger, J as shouldPublishLog } from './shared/better-auth.CTQDLJN7.mjs';
|
|
2
2
|
export { AtomListener, BetterAuthClientPlugin, ClientOptions, InferActions, InferAdditionalFromClient, InferClientAPI, InferErrorCodes, InferPluginsFromClient, InferSessionFromClient, InferUserFromClient, IsSignal, Store } from './types/index.mjs';
|
|
3
3
|
export { H as HIDE_METADATA } from './shared/better-auth.DEHJp1rk.mjs';
|
|
4
|
-
export { g as generateState, p as parseState } from './shared/better-auth.
|
|
4
|
+
export { g as generateState, p as parseState } from './shared/better-auth.DZPJQ81N.mjs';
|
|
5
5
|
export * from 'better-call';
|
|
6
6
|
export * from 'zod';
|
|
7
7
|
export { D as DeepPartial, E as Expand, H as HasRequiredKeys, a as LiteralNumber, L as LiteralString, d as LiteralUnion, O as OmitId, c as PreserveJSDoc, b as Prettify, P as PrettifyDeep, R as RequiredKeysOf, S as StripEmptyObjects, U as UnionToIntersection, W as WithoutEmpty } from './shared/better-auth.Bi8FQwDD.mjs';
|
|
8
|
-
import '
|
|
9
|
-
import './shared/better-auth.BjoUuJNr.mjs';
|
|
8
|
+
import './shared/better-auth.BTnAiI8e.mjs';
|
|
10
9
|
import 'jose';
|
|
10
|
+
import 'kysely';
|
|
11
11
|
import 'better-sqlite3';
|
|
12
12
|
import '@better-fetch/fetch';
|
|
13
13
|
import 'nanostores';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { u as Account, g as Adapter, x as AdapterInstance, w as AdapterSchemaCreation, r as AdditionalSessionFieldsInput, s as AdditionalSessionFieldsOutput, p as AdditionalUserFieldsInput, q as AdditionalUserFieldsOutput, i as Auth, l as AuthContext, A as AuthPluginSchema, f as BetterAuthOptions, B as BetterAuthPlugin, z as FilterActions, F as FilteredAPI, G as GenericEndpointContext, H as HookEndpointContext, D as InferAPI, I as InferOptionSchema, a as InferPluginErrorCodes, t as InferPluginTypes, k as InferSession, C as InferSessionAPI, j as InferUser, O as LogHandlerParams, L as LogLevel, N as Logger, M as Models, R as RateLimit, y as SecondaryStorage, S as Session, U as User, V as Verification, W as Where, m as WithJsDoc, n as betterAuth, P as createLogger, v as init, E as levels, Q as logger, J as shouldPublishLog } from './shared/better-auth.
|
|
1
|
+
export { u as Account, g as Adapter, x as AdapterInstance, w as AdapterSchemaCreation, r as AdditionalSessionFieldsInput, s as AdditionalSessionFieldsOutput, p as AdditionalUserFieldsInput, q as AdditionalUserFieldsOutput, i as Auth, l as AuthContext, A as AuthPluginSchema, f as BetterAuthOptions, B as BetterAuthPlugin, z as FilterActions, F as FilteredAPI, G as GenericEndpointContext, H as HookEndpointContext, D as InferAPI, I as InferOptionSchema, a as InferPluginErrorCodes, t as InferPluginTypes, k as InferSession, C as InferSessionAPI, j as InferUser, O as LogHandlerParams, L as LogLevel, N as Logger, M as Models, R as RateLimit, y as SecondaryStorage, S as Session, U as User, V as Verification, W as Where, m as WithJsDoc, n as betterAuth, P as createLogger, v as init, E as levels, Q as logger, J as shouldPublishLog } from './shared/better-auth.tpz8D0AA.js';
|
|
2
2
|
export { AtomListener, BetterAuthClientPlugin, ClientOptions, InferActions, InferAdditionalFromClient, InferClientAPI, InferErrorCodes, InferPluginsFromClient, InferSessionFromClient, InferUserFromClient, IsSignal, Store } from './types/index.js';
|
|
3
3
|
export { H as HIDE_METADATA } from './shared/better-auth.DEHJp1rk.js';
|
|
4
|
-
export { g as generateState, p as parseState } from './shared/better-auth.
|
|
4
|
+
export { g as generateState, p as parseState } from './shared/better-auth.DIOWNBS2.js';
|
|
5
5
|
export * from 'better-call';
|
|
6
6
|
export * from 'zod';
|
|
7
7
|
export { D as DeepPartial, E as Expand, H as HasRequiredKeys, a as LiteralNumber, L as LiteralString, d as LiteralUnion, O as OmitId, c as PreserveJSDoc, b as Prettify, P as PrettifyDeep, R as RequiredKeysOf, S as StripEmptyObjects, U as UnionToIntersection, W as WithoutEmpty } from './shared/better-auth.Bi8FQwDD.js';
|
|
8
|
-
import '
|
|
9
|
-
import './shared/better-auth.Dd96RDNl.js';
|
|
8
|
+
import './shared/better-auth.BAfIsot3.js';
|
|
10
9
|
import 'jose';
|
|
10
|
+
import 'kysely';
|
|
11
11
|
import 'better-sqlite3';
|
|
12
12
|
import '@better-fetch/fetch';
|
|
13
13
|
import 'nanostores';
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getEndpoints, router } from './api/index.mjs';
|
|
2
2
|
import { defu } from 'defu';
|
|
3
3
|
import { v as verifyPassword, h as hashPassword } from './shared/better-auth.OT3XFeFk.mjs';
|
|
4
|
-
import { a as getAdapter, c as createInternalAdapter, e as getMigrations } from './shared/better-auth.
|
|
4
|
+
import { a as getAdapter, c as createInternalAdapter, e as getMigrations } from './shared/better-auth.BK4Kh5QZ.mjs';
|
|
5
5
|
import { g as getAuthTables } from './shared/better-auth.DORkW_Ge.mjs';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import './shared/better-auth.CepcSj5H.mjs';
|
|
@@ -23,8 +23,8 @@ import { c as checkPassword } from './shared/better-auth.YwDQhoPc.mjs';
|
|
|
23
23
|
import { a as getBaseURL, g as getOrigin } from './shared/better-auth.VTXNLFMT.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.DQ-pFMwp.mjs';
|
|
27
|
+
export { H as HIDE_METADATA } from './shared/better-auth.DQ-pFMwp.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.BdyOG_p4.mjs';
|
|
30
30
|
import './shared/better-auth.DZGc_87_.mjs';
|
|
@@ -41,7 +41,7 @@ import './shared/better-auth.0TC26uRi.mjs';
|
|
|
41
41
|
import './shared/better-auth.DC8JQbiE.mjs';
|
|
42
42
|
import '@better-auth/utils/hmac';
|
|
43
43
|
import '@better-fetch/fetch';
|
|
44
|
-
import './shared/better-auth.
|
|
44
|
+
import './shared/better-auth.B2THyVQH.mjs';
|
|
45
45
|
import './shared/better-auth.DDEbWX-S.mjs';
|
|
46
46
|
import 'jose/errors';
|
|
47
47
|
import '@better-auth/utils/binary';
|
|
@@ -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
|
|
9
|
+
const refreshToken = require('../shared/better-auth.b0MLzqQX.cjs');
|
|
10
10
|
require('../shared/better-auth.C5H9XEzZ.cjs');
|
|
11
|
-
require('../shared/better-auth.
|
|
11
|
+
require('../shared/better-auth.B7irTavj.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.TNTVT6jt.cjs');
|
|
26
26
|
require('@better-auth/utils/otp');
|
|
27
27
|
require('../plugins/admin/access/index.cjs');
|
|
28
28
|
require('@better-fetch/fetch');
|
|
@@ -34,7 +34,7 @@ require('../shared/better-auth.C1hdVENX.cjs');
|
|
|
34
34
|
require('../shared/better-auth.D3mtHEZg.cjs');
|
|
35
35
|
require('../shared/better-auth.C-R0J0n1.cjs');
|
|
36
36
|
require('../social-providers/index.cjs');
|
|
37
|
-
require('../shared/better-auth.
|
|
37
|
+
require('../shared/better-auth.BLV8UOn8.cjs');
|
|
38
38
|
require('../shared/better-auth.QbbyHMYf.cjs');
|
|
39
39
|
require('../shared/better-auth.Bg6iw3ig.cjs');
|
|
40
40
|
require('../shared/better-auth.BMYo0QR-.cjs');
|
|
@@ -61,7 +61,7 @@ const nextCookies = () => {
|
|
|
61
61
|
matcher(ctx) {
|
|
62
62
|
return true;
|
|
63
63
|
},
|
|
64
|
-
handler:
|
|
64
|
+
handler: refreshToken.createAuthMiddleware(async (ctx) => {
|
|
65
65
|
const returned = ctx.context.responseHeaders;
|
|
66
66
|
if ("_flag" in ctx && ctx._flag === "router") {
|
|
67
67
|
return;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
|
-
import { H as HookEndpointContext } from '../shared/better-auth.
|
|
2
|
+
import { H as HookEndpointContext } from '../shared/better-auth.BDAwKjlL.cjs';
|
|
3
3
|
import '../shared/better-auth.Bi8FQwDD.cjs';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '
|
|
6
|
-
import '../shared/better-auth.CzK7QJBv.cjs';
|
|
5
|
+
import '../shared/better-auth.CH6fRG6d.cjs';
|
|
7
6
|
import 'jose';
|
|
7
|
+
import 'kysely';
|
|
8
8
|
import 'better-sqlite3';
|
|
9
9
|
|
|
10
10
|
declare function toNextJsHandler(auth: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
|
-
import { H as HookEndpointContext } from '../shared/better-auth.
|
|
2
|
+
import { H as HookEndpointContext } from '../shared/better-auth.CTQDLJN7.mjs';
|
|
3
3
|
import '../shared/better-auth.Bi8FQwDD.mjs';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '
|
|
6
|
-
import '../shared/better-auth.BjoUuJNr.mjs';
|
|
5
|
+
import '../shared/better-auth.BTnAiI8e.mjs';
|
|
7
6
|
import 'jose';
|
|
7
|
+
import 'kysely';
|
|
8
8
|
import 'better-sqlite3';
|
|
9
9
|
|
|
10
10
|
declare function toNextJsHandler(auth: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
|
-
import { H as HookEndpointContext } from '../shared/better-auth.
|
|
2
|
+
import { H as HookEndpointContext } from '../shared/better-auth.tpz8D0AA.js';
|
|
3
3
|
import '../shared/better-auth.Bi8FQwDD.js';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '
|
|
6
|
-
import '../shared/better-auth.Dd96RDNl.js';
|
|
5
|
+
import '../shared/better-auth.BAfIsot3.js';
|
|
7
6
|
import 'jose';
|
|
7
|
+
import 'kysely';
|
|
8
8
|
import 'better-sqlite3';
|
|
9
9
|
|
|
10
10
|
declare function toNextJsHandler(auth: {
|
|
@@ -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.DQ-pFMwp.mjs';
|
|
8
8
|
import '../shared/better-auth.CepcSj5H.mjs';
|
|
9
|
-
import '../shared/better-auth.
|
|
9
|
+
import '../shared/better-auth.9knM1kR4.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.2rfXmCNS.mjs';
|
|
24
24
|
import '@better-auth/utils/otp';
|
|
25
25
|
import '../plugins/admin/access/index.mjs';
|
|
26
26
|
import '@better-fetch/fetch';
|
|
@@ -32,7 +32,7 @@ import '../shared/better-auth.CW6D9eSx.mjs';
|
|
|
32
32
|
import '../shared/better-auth.tB5eU6EY.mjs';
|
|
33
33
|
import '../shared/better-auth.VTXNLFMT.mjs';
|
|
34
34
|
import '../social-providers/index.mjs';
|
|
35
|
-
import '../shared/better-auth.
|
|
35
|
+
import '../shared/better-auth.B2THyVQH.mjs';
|
|
36
36
|
import '../shared/better-auth.BdyOG_p4.mjs';
|
|
37
37
|
import '../shared/better-auth.BUPPRXfK.mjs';
|
|
38
38
|
import '../shared/better-auth.DDEbWX-S.mjs';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as http from 'http';
|
|
2
2
|
import { IncomingHttpHeaders } from 'http';
|
|
3
|
-
import { i as Auth } from '../shared/better-auth.
|
|
3
|
+
import { i as Auth } from '../shared/better-auth.BDAwKjlL.cjs';
|
|
4
4
|
import '../shared/better-auth.Bi8FQwDD.cjs';
|
|
5
5
|
import 'zod';
|
|
6
|
+
import '../shared/better-auth.CH6fRG6d.cjs';
|
|
7
|
+
import 'jose';
|
|
6
8
|
import 'kysely';
|
|
7
9
|
import 'better-call';
|
|
8
|
-
import '../shared/better-auth.CzK7QJBv.cjs';
|
|
9
|
-
import 'jose';
|
|
10
10
|
import 'better-sqlite3';
|
|
11
11
|
|
|
12
12
|
declare const toNodeHandler: (auth: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as http from 'http';
|
|
2
2
|
import { IncomingHttpHeaders } from 'http';
|
|
3
|
-
import { i as Auth } from '../shared/better-auth.
|
|
3
|
+
import { i as Auth } from '../shared/better-auth.CTQDLJN7.mjs';
|
|
4
4
|
import '../shared/better-auth.Bi8FQwDD.mjs';
|
|
5
5
|
import 'zod';
|
|
6
|
+
import '../shared/better-auth.BTnAiI8e.mjs';
|
|
7
|
+
import 'jose';
|
|
6
8
|
import 'kysely';
|
|
7
9
|
import 'better-call';
|
|
8
|
-
import '../shared/better-auth.BjoUuJNr.mjs';
|
|
9
|
-
import 'jose';
|
|
10
10
|
import 'better-sqlite3';
|
|
11
11
|
|
|
12
12
|
declare const toNodeHandler: (auth: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as http from 'http';
|
|
2
2
|
import { IncomingHttpHeaders } from 'http';
|
|
3
|
-
import { i as Auth } from '../shared/better-auth.
|
|
3
|
+
import { i as Auth } from '../shared/better-auth.tpz8D0AA.js';
|
|
4
4
|
import '../shared/better-auth.Bi8FQwDD.js';
|
|
5
5
|
import 'zod';
|
|
6
|
+
import '../shared/better-auth.BAfIsot3.js';
|
|
7
|
+
import 'jose';
|
|
6
8
|
import 'kysely';
|
|
7
9
|
import 'better-call';
|
|
8
|
-
import '../shared/better-auth.Dd96RDNl.js';
|
|
9
|
-
import 'jose';
|
|
10
10
|
import 'better-sqlite3';
|
|
11
11
|
|
|
12
12
|
declare const toNodeHandler: (auth: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { f as BetterAuthOptions } from '../shared/better-auth.
|
|
1
|
+
import { f as BetterAuthOptions } from '../shared/better-auth.BDAwKjlL.cjs';
|
|
2
2
|
import '../shared/better-auth.Bi8FQwDD.cjs';
|
|
3
3
|
import 'zod';
|
|
4
|
+
import '../shared/better-auth.CH6fRG6d.cjs';
|
|
5
|
+
import 'jose';
|
|
4
6
|
import 'kysely';
|
|
5
7
|
import 'better-call';
|
|
6
|
-
import '../shared/better-auth.CzK7QJBv.cjs';
|
|
7
|
-
import 'jose';
|
|
8
8
|
import 'better-sqlite3';
|
|
9
9
|
|
|
10
10
|
declare const toSvelteKitHandler: (auth: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { f as BetterAuthOptions } from '../shared/better-auth.
|
|
1
|
+
import { f as BetterAuthOptions } from '../shared/better-auth.CTQDLJN7.mjs';
|
|
2
2
|
import '../shared/better-auth.Bi8FQwDD.mjs';
|
|
3
3
|
import 'zod';
|
|
4
|
+
import '../shared/better-auth.BTnAiI8e.mjs';
|
|
5
|
+
import 'jose';
|
|
4
6
|
import 'kysely';
|
|
5
7
|
import 'better-call';
|
|
6
|
-
import '../shared/better-auth.BjoUuJNr.mjs';
|
|
7
|
-
import 'jose';
|
|
8
8
|
import 'better-sqlite3';
|
|
9
9
|
|
|
10
10
|
declare const toSvelteKitHandler: (auth: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { f as BetterAuthOptions } from '../shared/better-auth.
|
|
1
|
+
import { f as BetterAuthOptions } from '../shared/better-auth.tpz8D0AA.js';
|
|
2
2
|
import '../shared/better-auth.Bi8FQwDD.js';
|
|
3
3
|
import 'zod';
|
|
4
|
+
import '../shared/better-auth.BAfIsot3.js';
|
|
5
|
+
import 'jose';
|
|
4
6
|
import 'kysely';
|
|
5
7
|
import 'better-call';
|
|
6
|
-
import '../shared/better-auth.Dd96RDNl.js';
|
|
7
|
-
import 'jose';
|
|
8
8
|
import 'better-sqlite3';
|
|
9
9
|
|
|
10
10
|
declare const toSvelteKitHandler: (auth: {
|
package/dist/oauth2/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const refreshAccessToken = require('../shared/better-auth.BLV8UOn8.cjs');
|
|
4
4
|
const state = require('../shared/better-auth.QbbyHMYf.cjs');
|
|
5
5
|
require('@better-fetch/fetch');
|
|
6
6
|
require('../shared/better-auth.C1hdVENX.cjs');
|
|
@@ -21,10 +21,11 @@ require('@better-auth/utils/random');
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
exports.createAuthorizationURL =
|
|
25
|
-
exports.generateCodeChallenge =
|
|
26
|
-
exports.getOAuth2Tokens =
|
|
27
|
-
exports.
|
|
28
|
-
exports.
|
|
24
|
+
exports.createAuthorizationURL = refreshAccessToken.createAuthorizationURL;
|
|
25
|
+
exports.generateCodeChallenge = refreshAccessToken.generateCodeChallenge;
|
|
26
|
+
exports.getOAuth2Tokens = refreshAccessToken.getOAuth2Tokens;
|
|
27
|
+
exports.refreshAccessToken = refreshAccessToken.refreshAccessToken;
|
|
28
|
+
exports.validateAuthorizationCode = refreshAccessToken.validateAuthorizationCode;
|
|
29
|
+
exports.validateToken = refreshAccessToken.validateToken;
|
|
29
30
|
exports.generateState = state.generateState;
|
|
30
31
|
exports.parseState = state.parseState;
|
package/dist/oauth2/index.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { P as ProviderOptions, O as OAuth2Tokens } from '../shared/better-auth.
|
|
2
|
-
export { a as OAuthProvider } from '../shared/better-auth.
|
|
1
|
+
import { P as ProviderOptions, O as OAuth2Tokens } from '../shared/better-auth.CH6fRG6d.cjs';
|
|
2
|
+
export { a as OAuthProvider } from '../shared/better-auth.CH6fRG6d.cjs';
|
|
3
3
|
import * as jose from 'jose';
|
|
4
|
-
export { g as generateState, p as parseState } from '../shared/better-auth.
|
|
4
|
+
export { g as generateState, p as parseState } from '../shared/better-auth.DAnkIG1r.cjs';
|
|
5
5
|
import '../shared/better-auth.Bi8FQwDD.cjs';
|
|
6
6
|
import 'zod';
|
|
7
|
-
import '../shared/better-auth.
|
|
7
|
+
import '../shared/better-auth.BDAwKjlL.cjs';
|
|
8
8
|
import 'kysely';
|
|
9
9
|
import 'better-call';
|
|
10
10
|
import 'better-sqlite3';
|
|
@@ -41,7 +41,16 @@ declare function validateAuthorizationCode({ code, codeVerifier, redirectURI, op
|
|
|
41
41
|
}): Promise<OAuth2Tokens>;
|
|
42
42
|
declare function validateToken(token: string, jwksEndpoint: string): Promise<jose.JWTVerifyResult<jose.JWTPayload>>;
|
|
43
43
|
|
|
44
|
+
declare function refreshAccessToken({ refreshToken, options, tokenEndpoint, authentication, extraParams, grantType, }: {
|
|
45
|
+
refreshToken: string;
|
|
46
|
+
options: ProviderOptions;
|
|
47
|
+
tokenEndpoint: string;
|
|
48
|
+
authentication?: "basic" | "post";
|
|
49
|
+
extraParams?: Record<string, string>;
|
|
50
|
+
grantType?: string;
|
|
51
|
+
}): Promise<OAuth2Tokens>;
|
|
52
|
+
|
|
44
53
|
declare function generateCodeChallenge(codeVerifier: string): Promise<string>;
|
|
45
54
|
declare function getOAuth2Tokens(data: Record<string, any>): OAuth2Tokens;
|
|
46
55
|
|
|
47
|
-
export { OAuth2Tokens, ProviderOptions, createAuthorizationURL, generateCodeChallenge, getOAuth2Tokens, validateAuthorizationCode, validateToken };
|
|
56
|
+
export { OAuth2Tokens, ProviderOptions, createAuthorizationURL, generateCodeChallenge, getOAuth2Tokens, refreshAccessToken, validateAuthorizationCode, validateToken };
|
package/dist/oauth2/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { P as ProviderOptions, O as OAuth2Tokens } from '../shared/better-auth.
|
|
2
|
-
export { a as OAuthProvider } from '../shared/better-auth.
|
|
1
|
+
import { P as ProviderOptions, O as OAuth2Tokens } from '../shared/better-auth.BTnAiI8e.mjs';
|
|
2
|
+
export { a as OAuthProvider } from '../shared/better-auth.BTnAiI8e.mjs';
|
|
3
3
|
import * as jose from 'jose';
|
|
4
|
-
export { g as generateState, p as parseState } from '../shared/better-auth.
|
|
4
|
+
export { g as generateState, p as parseState } from '../shared/better-auth.DZPJQ81N.mjs';
|
|
5
5
|
import '../shared/better-auth.Bi8FQwDD.mjs';
|
|
6
6
|
import 'zod';
|
|
7
|
-
import '../shared/better-auth.
|
|
7
|
+
import '../shared/better-auth.CTQDLJN7.mjs';
|
|
8
8
|
import 'kysely';
|
|
9
9
|
import 'better-call';
|
|
10
10
|
import 'better-sqlite3';
|
|
@@ -41,7 +41,16 @@ declare function validateAuthorizationCode({ code, codeVerifier, redirectURI, op
|
|
|
41
41
|
}): Promise<OAuth2Tokens>;
|
|
42
42
|
declare function validateToken(token: string, jwksEndpoint: string): Promise<jose.JWTVerifyResult<jose.JWTPayload>>;
|
|
43
43
|
|
|
44
|
+
declare function refreshAccessToken({ refreshToken, options, tokenEndpoint, authentication, extraParams, grantType, }: {
|
|
45
|
+
refreshToken: string;
|
|
46
|
+
options: ProviderOptions;
|
|
47
|
+
tokenEndpoint: string;
|
|
48
|
+
authentication?: "basic" | "post";
|
|
49
|
+
extraParams?: Record<string, string>;
|
|
50
|
+
grantType?: string;
|
|
51
|
+
}): Promise<OAuth2Tokens>;
|
|
52
|
+
|
|
44
53
|
declare function generateCodeChallenge(codeVerifier: string): Promise<string>;
|
|
45
54
|
declare function getOAuth2Tokens(data: Record<string, any>): OAuth2Tokens;
|
|
46
55
|
|
|
47
|
-
export { OAuth2Tokens, ProviderOptions, createAuthorizationURL, generateCodeChallenge, getOAuth2Tokens, validateAuthorizationCode, validateToken };
|
|
56
|
+
export { OAuth2Tokens, ProviderOptions, createAuthorizationURL, generateCodeChallenge, getOAuth2Tokens, refreshAccessToken, validateAuthorizationCode, validateToken };
|
package/dist/oauth2/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { P as ProviderOptions, O as OAuth2Tokens } from '../shared/better-auth.
|
|
2
|
-
export { a as OAuthProvider } from '../shared/better-auth.
|
|
1
|
+
import { P as ProviderOptions, O as OAuth2Tokens } from '../shared/better-auth.BAfIsot3.js';
|
|
2
|
+
export { a as OAuthProvider } from '../shared/better-auth.BAfIsot3.js';
|
|
3
3
|
import * as jose from 'jose';
|
|
4
|
-
export { g as generateState, p as parseState } from '../shared/better-auth.
|
|
4
|
+
export { g as generateState, p as parseState } from '../shared/better-auth.DIOWNBS2.js';
|
|
5
5
|
import '../shared/better-auth.Bi8FQwDD.js';
|
|
6
6
|
import 'zod';
|
|
7
|
-
import '../shared/better-auth.
|
|
7
|
+
import '../shared/better-auth.tpz8D0AA.js';
|
|
8
8
|
import 'kysely';
|
|
9
9
|
import 'better-call';
|
|
10
10
|
import 'better-sqlite3';
|
|
@@ -41,7 +41,16 @@ declare function validateAuthorizationCode({ code, codeVerifier, redirectURI, op
|
|
|
41
41
|
}): Promise<OAuth2Tokens>;
|
|
42
42
|
declare function validateToken(token: string, jwksEndpoint: string): Promise<jose.JWTVerifyResult<jose.JWTPayload>>;
|
|
43
43
|
|
|
44
|
+
declare function refreshAccessToken({ refreshToken, options, tokenEndpoint, authentication, extraParams, grantType, }: {
|
|
45
|
+
refreshToken: string;
|
|
46
|
+
options: ProviderOptions;
|
|
47
|
+
tokenEndpoint: string;
|
|
48
|
+
authentication?: "basic" | "post";
|
|
49
|
+
extraParams?: Record<string, string>;
|
|
50
|
+
grantType?: string;
|
|
51
|
+
}): Promise<OAuth2Tokens>;
|
|
52
|
+
|
|
44
53
|
declare function generateCodeChallenge(codeVerifier: string): Promise<string>;
|
|
45
54
|
declare function getOAuth2Tokens(data: Record<string, any>): OAuth2Tokens;
|
|
46
55
|
|
|
47
|
-
export { OAuth2Tokens, ProviderOptions, createAuthorizationURL, generateCodeChallenge, getOAuth2Tokens, validateAuthorizationCode, validateToken };
|
|
56
|
+
export { OAuth2Tokens, ProviderOptions, createAuthorizationURL, generateCodeChallenge, getOAuth2Tokens, refreshAccessToken, validateAuthorizationCode, validateToken };
|
package/dist/oauth2/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as createAuthorizationURL, g as generateCodeChallenge, b as getOAuth2Tokens, v as validateAuthorizationCode, a as validateToken } from '../shared/better-auth.
|
|
1
|
+
export { c as createAuthorizationURL, g as generateCodeChallenge, b as getOAuth2Tokens, r as refreshAccessToken, v as validateAuthorizationCode, a as validateToken } from '../shared/better-auth.B2THyVQH.mjs';
|
|
2
2
|
export { g as generateState, p as parseState } from '../shared/better-auth.BdyOG_p4.mjs';
|
|
3
3
|
import '@better-fetch/fetch';
|
|
4
4
|
import '../shared/better-auth.CW6D9eSx.mjs';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const admin = require('../../shared/better-auth.
|
|
3
|
+
const admin = require('../../shared/better-auth.DqGx7Ip8.cjs');
|
|
4
4
|
require('zod');
|
|
5
5
|
require('better-call');
|
|
6
|
-
require('../../shared/better-auth.
|
|
6
|
+
require('../../shared/better-auth.b0MLzqQX.cjs');
|
|
7
7
|
require('../../cookies/index.cjs');
|
|
8
8
|
require('../../shared/better-auth.ANpbi45u.cjs');
|
|
9
9
|
require('../../shared/better-auth.C1hdVENX.cjs');
|
|
@@ -15,7 +15,7 @@ require('../../shared/better-auth.C-R0J0n1.cjs');
|
|
|
15
15
|
require('../../social-providers/index.cjs');
|
|
16
16
|
require('@better-fetch/fetch');
|
|
17
17
|
require('jose');
|
|
18
|
-
require('../../shared/better-auth.
|
|
18
|
+
require('../../shared/better-auth.BLV8UOn8.cjs');
|
|
19
19
|
require('@better-auth/utils/hash');
|
|
20
20
|
require('@noble/ciphers/chacha');
|
|
21
21
|
require('@noble/ciphers/utils');
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AccessControl, Role, Statements } from '../access/index.cjs';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { I as InferOptionSchema, l as AuthContext, H as HookEndpointContext, S as Session, U as User } from '../../shared/better-auth.
|
|
4
|
+
import { I as InferOptionSchema, l as AuthContext, H as HookEndpointContext, S as Session, U as User } from '../../shared/better-auth.BDAwKjlL.cjs';
|
|
5
5
|
import '../../shared/better-auth.Bi8FQwDD.cjs';
|
|
6
|
-
import '
|
|
7
|
-
import '../../shared/better-auth.CzK7QJBv.cjs';
|
|
6
|
+
import '../../shared/better-auth.CH6fRG6d.cjs';
|
|
8
7
|
import 'jose';
|
|
8
|
+
import 'kysely';
|
|
9
9
|
import 'better-sqlite3';
|
|
10
10
|
|
|
11
11
|
interface UserWithRole extends User {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AccessControl, Role, Statements } from '../access/index.mjs';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { I as InferOptionSchema, l as AuthContext, H as HookEndpointContext, S as Session, U as User } from '../../shared/better-auth.
|
|
4
|
+
import { I as InferOptionSchema, l as AuthContext, H as HookEndpointContext, S as Session, U as User } from '../../shared/better-auth.CTQDLJN7.mjs';
|
|
5
5
|
import '../../shared/better-auth.Bi8FQwDD.mjs';
|
|
6
|
-
import '
|
|
7
|
-
import '../../shared/better-auth.BjoUuJNr.mjs';
|
|
6
|
+
import '../../shared/better-auth.BTnAiI8e.mjs';
|
|
8
7
|
import 'jose';
|
|
8
|
+
import 'kysely';
|
|
9
9
|
import 'better-sqlite3';
|
|
10
10
|
|
|
11
11
|
interface UserWithRole extends User {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AccessControl, Role, Statements } from '../access/index.js';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { I as InferOptionSchema, l as AuthContext, H as HookEndpointContext, S as Session, U as User } from '../../shared/better-auth.
|
|
4
|
+
import { I as InferOptionSchema, l as AuthContext, H as HookEndpointContext, S as Session, U as User } from '../../shared/better-auth.tpz8D0AA.js';
|
|
5
5
|
import '../../shared/better-auth.Bi8FQwDD.js';
|
|
6
|
-
import '
|
|
7
|
-
import '../../shared/better-auth.Dd96RDNl.js';
|
|
6
|
+
import '../../shared/better-auth.BAfIsot3.js';
|
|
8
7
|
import 'jose';
|
|
8
|
+
import 'kysely';
|
|
9
9
|
import 'better-sqlite3';
|
|
10
10
|
|
|
11
11
|
interface UserWithRole extends User {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { a as admin } from '../../shared/better-auth.
|
|
1
|
+
export { a as admin } from '../../shared/better-auth.cN4sTcuQ.mjs';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import 'better-call';
|
|
4
|
-
import '../../shared/better-auth.
|
|
4
|
+
import '../../shared/better-auth.DQ-pFMwp.mjs';
|
|
5
5
|
import '../../cookies/index.mjs';
|
|
6
6
|
import '../../shared/better-auth.DdzSJf-n.mjs';
|
|
7
7
|
import '../../shared/better-auth.CW6D9eSx.mjs';
|
|
@@ -13,7 +13,7 @@ import '../../shared/better-auth.VTXNLFMT.mjs';
|
|
|
13
13
|
import '../../social-providers/index.mjs';
|
|
14
14
|
import '@better-fetch/fetch';
|
|
15
15
|
import 'jose';
|
|
16
|
-
import '../../shared/better-auth.
|
|
16
|
+
import '../../shared/better-auth.B2THyVQH.mjs';
|
|
17
17
|
import '@better-auth/utils/hash';
|
|
18
18
|
import '@noble/ciphers/chacha';
|
|
19
19
|
import '@noble/ciphers/utils';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const betterCall = require('better-call');
|
|
4
|
-
const
|
|
4
|
+
const refreshToken = require('../../shared/better-auth.b0MLzqQX.cjs');
|
|
5
5
|
require('zod');
|
|
6
6
|
const cookies_index = require('../../cookies/index.cjs');
|
|
7
7
|
const schema$1 = require('../../shared/better-auth.C5H9XEzZ.cjs');
|
|
@@ -12,7 +12,7 @@ const url = require('../../shared/better-auth.C-R0J0n1.cjs');
|
|
|
12
12
|
require('../../social-providers/index.cjs');
|
|
13
13
|
require('@better-fetch/fetch');
|
|
14
14
|
require('jose');
|
|
15
|
-
require('../../shared/better-auth.
|
|
15
|
+
require('../../shared/better-auth.BLV8UOn8.cjs');
|
|
16
16
|
require('../../shared/better-auth.C1hdVENX.cjs');
|
|
17
17
|
require('@better-auth/utils/hash');
|
|
18
18
|
require('@better-auth/utils/base64');
|
|
@@ -53,7 +53,7 @@ const anonymous = (options) => {
|
|
|
53
53
|
return {
|
|
54
54
|
id: "anonymous",
|
|
55
55
|
endpoints: {
|
|
56
|
-
signInAnonymous:
|
|
56
|
+
signInAnonymous: refreshToken.createAuthEndpoint(
|
|
57
57
|
"/sign-in/anonymous",
|
|
58
58
|
{
|
|
59
59
|
method: "POST",
|
|
@@ -140,14 +140,14 @@ const anonymous = (options) => {
|
|
|
140
140
|
matcher(ctx) {
|
|
141
141
|
return ctx.path.startsWith("/sign-in") || ctx.path.startsWith("/sign-up") || ctx.path.startsWith("/callback") || ctx.path.startsWith("/oauth2/callback") || ctx.path.startsWith("/magic-link/verify") || ctx.path.startsWith("/email-otp/verify-email");
|
|
142
142
|
},
|
|
143
|
-
handler:
|
|
143
|
+
handler: refreshToken.createAuthMiddleware(async (ctx) => {
|
|
144
144
|
const setCookie = ctx.context.responseHeaders?.get("set-cookie");
|
|
145
145
|
const sessionTokenName = ctx.context.authCookies.sessionToken.name;
|
|
146
146
|
const sessionCookie = cookies_index.parseSetCookieHeader(setCookie || "").get(sessionTokenName)?.value.split(".")[0];
|
|
147
147
|
if (!sessionCookie) {
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
|
-
const session = await
|
|
150
|
+
const session = await refreshToken.getSessionFromCtx(
|
|
151
151
|
ctx,
|
|
152
152
|
{
|
|
153
153
|
disableRefresh: true
|