@better-auth/core 1.5.7-beta.1 → 1.6.0
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.d.mts +12 -43
- package/dist/api/index.mjs +0 -3
- package/dist/async_hooks/index.d.mts +1 -2
- package/dist/async_hooks/index.mjs +0 -2
- package/dist/async_hooks/pure.index.d.mts +1 -2
- package/dist/async_hooks/pure.index.mjs +0 -2
- package/dist/context/endpoint-context.d.mts +2 -3
- package/dist/context/endpoint-context.mjs +0 -2
- package/dist/context/global.d.mts +1 -2
- package/dist/context/global.mjs +1 -3
- package/dist/context/request-state.d.mts +1 -2
- package/dist/context/request-state.mjs +0 -2
- package/dist/context/transaction.d.mts +1 -2
- package/dist/context/transaction.mjs +0 -2
- package/dist/db/adapter/factory.d.mts +1 -2
- package/dist/db/adapter/factory.mjs +3 -6
- package/dist/db/adapter/get-default-field-name.d.mts +1 -2
- package/dist/db/adapter/get-default-field-name.mjs +0 -2
- package/dist/db/adapter/get-default-model-name.d.mts +1 -2
- package/dist/db/adapter/get-default-model-name.mjs +0 -2
- package/dist/db/adapter/get-field-attributes.d.mts +1 -2
- package/dist/db/adapter/get-field-attributes.mjs +0 -2
- package/dist/db/adapter/get-field-name.d.mts +1 -2
- package/dist/db/adapter/get-field-name.mjs +0 -2
- package/dist/db/adapter/get-id-field.d.mts +1 -2
- package/dist/db/adapter/get-id-field.mjs +0 -3
- package/dist/db/adapter/get-model-name.d.mts +1 -2
- package/dist/db/adapter/get-model-name.mjs +0 -2
- package/dist/db/adapter/index.d.mts +9 -2
- package/dist/db/adapter/index.mjs +0 -2
- package/dist/db/adapter/types.d.mts +1 -2
- package/dist/db/adapter/utils.d.mts +1 -2
- package/dist/db/adapter/utils.mjs +0 -2
- package/dist/db/get-tables.d.mts +1 -2
- package/dist/db/get-tables.mjs +0 -2
- package/dist/db/plugin.d.mts +1 -2
- package/dist/db/schema/account.d.mts +1 -2
- package/dist/db/schema/account.mjs +0 -2
- package/dist/db/schema/rate-limit.d.mts +1 -2
- package/dist/db/schema/rate-limit.mjs +0 -2
- package/dist/db/schema/session.d.mts +1 -2
- package/dist/db/schema/session.mjs +0 -2
- package/dist/db/schema/shared.d.mts +1 -2
- package/dist/db/schema/shared.mjs +0 -2
- package/dist/db/schema/user.d.mts +1 -2
- package/dist/db/schema/user.mjs +0 -2
- package/dist/db/schema/verification.d.mts +1 -2
- package/dist/db/schema/verification.mjs +0 -2
- package/dist/db/type.d.mts +1 -2
- package/dist/env/color-depth.d.mts +1 -2
- package/dist/env/color-depth.mjs +0 -2
- package/dist/env/env-impl.d.mts +1 -2
- package/dist/env/env-impl.mjs +0 -2
- package/dist/env/logger.d.mts +1 -2
- package/dist/env/logger.mjs +0 -2
- package/dist/error/codes.d.mts +1 -2
- package/dist/error/codes.mjs +0 -2
- package/dist/error/index.d.mts +1 -2
- package/dist/error/index.mjs +0 -2
- package/dist/instrumentation/attributes.d.mts +1 -2
- package/dist/instrumentation/attributes.mjs +0 -2
- package/dist/instrumentation/tracer.d.mts +1 -2
- package/dist/instrumentation/tracer.mjs +29 -15
- package/dist/oauth2/client-credentials-token.d.mts +1 -2
- package/dist/oauth2/client-credentials-token.mjs +0 -2
- package/dist/oauth2/create-authorization-url.d.mts +1 -2
- package/dist/oauth2/create-authorization-url.mjs +0 -2
- package/dist/oauth2/oauth-provider.d.mts +1 -2
- package/dist/oauth2/refresh-access-token.d.mts +1 -2
- package/dist/oauth2/refresh-access-token.mjs +0 -2
- package/dist/oauth2/utils.d.mts +1 -2
- package/dist/oauth2/utils.mjs +0 -2
- package/dist/oauth2/validate-authorization-code.d.mts +1 -2
- package/dist/oauth2/validate-authorization-code.mjs +0 -3
- package/dist/oauth2/verify.d.mts +1 -2
- package/dist/oauth2/verify.mjs +0 -3
- package/dist/social-providers/apple.d.mts +1 -2
- package/dist/social-providers/apple.mjs +0 -3
- package/dist/social-providers/atlassian.d.mts +1 -2
- package/dist/social-providers/atlassian.mjs +0 -4
- package/dist/social-providers/cognito.d.mts +1 -2
- package/dist/social-providers/cognito.mjs +0 -4
- package/dist/social-providers/discord.d.mts +1 -2
- package/dist/social-providers/discord.mjs +0 -3
- package/dist/social-providers/dropbox.d.mts +1 -2
- package/dist/social-providers/dropbox.mjs +0 -3
- package/dist/social-providers/facebook.d.mts +1 -2
- package/dist/social-providers/facebook.mjs +0 -3
- package/dist/social-providers/figma.d.mts +1 -2
- package/dist/social-providers/figma.mjs +0 -4
- package/dist/social-providers/github.d.mts +1 -2
- package/dist/social-providers/github.mjs +0 -4
- package/dist/social-providers/gitlab.d.mts +1 -2
- package/dist/social-providers/gitlab.mjs +0 -3
- package/dist/social-providers/google.d.mts +1 -2
- package/dist/social-providers/google.mjs +0 -4
- package/dist/social-providers/huggingface.d.mts +1 -2
- package/dist/social-providers/huggingface.mjs +0 -3
- package/dist/social-providers/index.d.mts +1 -2
- package/dist/social-providers/index.mjs +0 -2
- package/dist/social-providers/kakao.d.mts +1 -2
- package/dist/social-providers/kakao.mjs +0 -3
- package/dist/social-providers/kick.d.mts +1 -2
- package/dist/social-providers/kick.mjs +0 -3
- package/dist/social-providers/line.d.mts +1 -2
- package/dist/social-providers/line.mjs +0 -3
- package/dist/social-providers/linear.d.mts +1 -2
- package/dist/social-providers/linear.mjs +0 -3
- package/dist/social-providers/linkedin.d.mts +1 -2
- package/dist/social-providers/linkedin.mjs +0 -3
- package/dist/social-providers/microsoft-entra-id.d.mts +1 -2
- package/dist/social-providers/microsoft-entra-id.mjs +0 -4
- package/dist/social-providers/naver.d.mts +1 -2
- package/dist/social-providers/naver.mjs +0 -3
- package/dist/social-providers/notion.d.mts +1 -2
- package/dist/social-providers/notion.mjs +0 -3
- package/dist/social-providers/paybin.d.mts +1 -2
- package/dist/social-providers/paybin.mjs +0 -4
- package/dist/social-providers/paypal.d.mts +1 -2
- package/dist/social-providers/paypal.mjs +0 -4
- package/dist/social-providers/polar.d.mts +1 -2
- package/dist/social-providers/polar.mjs +0 -3
- package/dist/social-providers/railway.d.mts +1 -2
- package/dist/social-providers/railway.mjs +0 -3
- package/dist/social-providers/reddit.d.mts +1 -2
- package/dist/social-providers/reddit.mjs +0 -3
- package/dist/social-providers/roblox.d.mts +1 -2
- package/dist/social-providers/roblox.mjs +0 -3
- package/dist/social-providers/salesforce.d.mts +1 -2
- package/dist/social-providers/salesforce.mjs +0 -4
- package/dist/social-providers/slack.d.mts +1 -2
- package/dist/social-providers/slack.mjs +0 -3
- package/dist/social-providers/spotify.d.mts +1 -2
- package/dist/social-providers/spotify.mjs +0 -3
- package/dist/social-providers/tiktok.d.mts +1 -2
- package/dist/social-providers/tiktok.mjs +0 -3
- package/dist/social-providers/twitch.d.mts +1 -2
- package/dist/social-providers/twitch.mjs +0 -4
- package/dist/social-providers/twitter.d.mts +1 -2
- package/dist/social-providers/twitter.mjs +0 -3
- package/dist/social-providers/vercel.d.mts +1 -2
- package/dist/social-providers/vercel.mjs +0 -3
- package/dist/social-providers/vk.d.mts +1 -2
- package/dist/social-providers/vk.mjs +0 -3
- package/dist/social-providers/wechat.d.mts +1 -2
- package/dist/social-providers/wechat.mjs +0 -2
- package/dist/social-providers/zoom.d.mts +1 -2
- package/dist/social-providers/zoom.mjs +0 -3
- package/dist/types/context.d.mts +5 -3
- package/dist/types/cookie.d.mts +1 -2
- package/dist/types/helper.d.mts +1 -2
- package/dist/types/init-options.d.mts +14 -6
- package/dist/types/plugin-client.d.mts +2 -2
- package/dist/types/plugin.d.mts +3 -6
- package/dist/types/secret.d.mts +1 -2
- package/dist/utils/db.d.mts +1 -2
- package/dist/utils/db.mjs +0 -2
- package/dist/utils/deprecate.d.mts +1 -2
- package/dist/utils/deprecate.mjs +0 -2
- package/dist/utils/error-codes.d.mts +1 -2
- package/dist/utils/error-codes.mjs +0 -2
- package/dist/utils/fetch-metadata.d.mts +1 -2
- package/dist/utils/fetch-metadata.mjs +0 -2
- package/dist/utils/id.d.mts +1 -2
- package/dist/utils/id.mjs +0 -2
- package/dist/utils/ip.d.mts +1 -2
- package/dist/utils/ip.mjs +0 -2
- package/dist/utils/json.d.mts +1 -2
- package/dist/utils/json.mjs +0 -3
- package/dist/utils/string.d.mts +1 -2
- package/dist/utils/string.mjs +0 -2
- package/dist/utils/url.d.mts +1 -2
- package/dist/utils/url.mjs +0 -2
- package/package.json +9 -7
- package/src/api/index.ts +41 -151
- package/src/context/endpoint-context.ts +1 -2
- package/src/db/adapter/factory.ts +2 -0
- package/src/db/adapter/index.ts +8 -0
- package/src/instrumentation/tracer.ts +40 -12
- package/src/social-providers/index.ts +0 -2
- package/src/types/context.ts +4 -1
- package/src/types/init-options.ts +13 -4
- package/src/types/plugin-client.ts +1 -0
- package/src/types/plugin.ts +2 -14
- package/dist/api/index.mjs.map +0 -1
- package/dist/async_hooks/index.mjs.map +0 -1
- package/dist/async_hooks/pure.index.mjs.map +0 -1
- package/dist/context/endpoint-context.mjs.map +0 -1
- package/dist/context/global.mjs.map +0 -1
- package/dist/context/request-state.mjs.map +0 -1
- package/dist/context/transaction.mjs.map +0 -1
- package/dist/db/adapter/factory.mjs.map +0 -1
- package/dist/db/adapter/get-default-field-name.mjs.map +0 -1
- package/dist/db/adapter/get-default-model-name.mjs.map +0 -1
- package/dist/db/adapter/get-field-attributes.mjs.map +0 -1
- package/dist/db/adapter/get-field-name.mjs.map +0 -1
- package/dist/db/adapter/get-id-field.mjs.map +0 -1
- package/dist/db/adapter/get-model-name.mjs.map +0 -1
- package/dist/db/adapter/index.mjs.map +0 -1
- package/dist/db/adapter/utils.mjs.map +0 -1
- package/dist/db/get-tables.mjs.map +0 -1
- package/dist/db/schema/account.mjs.map +0 -1
- package/dist/db/schema/rate-limit.mjs.map +0 -1
- package/dist/db/schema/session.mjs.map +0 -1
- package/dist/db/schema/shared.mjs.map +0 -1
- package/dist/db/schema/user.mjs.map +0 -1
- package/dist/db/schema/verification.mjs.map +0 -1
- package/dist/env/color-depth.mjs.map +0 -1
- package/dist/env/env-impl.mjs.map +0 -1
- package/dist/env/logger.mjs.map +0 -1
- package/dist/error/codes.mjs.map +0 -1
- package/dist/error/index.mjs.map +0 -1
- package/dist/instrumentation/attributes.mjs.map +0 -1
- package/dist/instrumentation/tracer.mjs.map +0 -1
- package/dist/oauth2/client-credentials-token.mjs.map +0 -1
- package/dist/oauth2/create-authorization-url.mjs.map +0 -1
- package/dist/oauth2/refresh-access-token.mjs.map +0 -1
- package/dist/oauth2/utils.mjs.map +0 -1
- package/dist/oauth2/validate-authorization-code.mjs.map +0 -1
- package/dist/oauth2/verify.mjs.map +0 -1
- package/dist/social-providers/apple.mjs.map +0 -1
- package/dist/social-providers/atlassian.mjs.map +0 -1
- package/dist/social-providers/cognito.mjs.map +0 -1
- package/dist/social-providers/discord.mjs.map +0 -1
- package/dist/social-providers/dropbox.mjs.map +0 -1
- package/dist/social-providers/facebook.mjs.map +0 -1
- package/dist/social-providers/figma.mjs.map +0 -1
- package/dist/social-providers/github.mjs.map +0 -1
- package/dist/social-providers/gitlab.mjs.map +0 -1
- package/dist/social-providers/google.mjs.map +0 -1
- package/dist/social-providers/huggingface.mjs.map +0 -1
- package/dist/social-providers/index.mjs.map +0 -1
- package/dist/social-providers/kakao.mjs.map +0 -1
- package/dist/social-providers/kick.mjs.map +0 -1
- package/dist/social-providers/line.mjs.map +0 -1
- package/dist/social-providers/linear.mjs.map +0 -1
- package/dist/social-providers/linkedin.mjs.map +0 -1
- package/dist/social-providers/microsoft-entra-id.mjs.map +0 -1
- package/dist/social-providers/naver.mjs.map +0 -1
- package/dist/social-providers/notion.mjs.map +0 -1
- package/dist/social-providers/paybin.mjs.map +0 -1
- package/dist/social-providers/paypal.mjs.map +0 -1
- package/dist/social-providers/polar.mjs.map +0 -1
- package/dist/social-providers/railway.mjs.map +0 -1
- package/dist/social-providers/reddit.mjs.map +0 -1
- package/dist/social-providers/roblox.mjs.map +0 -1
- package/dist/social-providers/salesforce.mjs.map +0 -1
- package/dist/social-providers/slack.mjs.map +0 -1
- package/dist/social-providers/spotify.mjs.map +0 -1
- package/dist/social-providers/tiktok.mjs.map +0 -1
- package/dist/social-providers/twitch.mjs.map +0 -1
- package/dist/social-providers/twitter.mjs.map +0 -1
- package/dist/social-providers/vercel.mjs.map +0 -1
- package/dist/social-providers/vk.mjs.map +0 -1
- package/dist/social-providers/wechat.mjs.map +0 -1
- package/dist/social-providers/zoom.mjs.map +0 -1
- package/dist/utils/db.mjs.map +0 -1
- package/dist/utils/deprecate.mjs.map +0 -1
- package/dist/utils/error-codes.mjs.map +0 -1
- package/dist/utils/fetch-metadata.mjs.map +0 -1
- package/dist/utils/id.mjs.map +0 -1
- package/dist/utils/ip.mjs.map +0 -1
- package/dist/utils/json.mjs.map +0 -1
- package/dist/utils/string.mjs.map +0 -1
- package/dist/utils/url.mjs.map +0 -1
- package/src/context/request-state.test.ts +0 -94
- package/src/db/adapter/get-id-field.test.ts +0 -222
- package/src/db/test/get-tables.test.ts +0 -116
- package/src/env/logger.test.ts +0 -34
- package/src/instrumentation/instrumentation.test.ts +0 -139
- package/src/oauth2/refresh-access-token.test.ts +0 -90
- package/src/oauth2/validate-token.test.ts +0 -229
- package/src/utils/deprecate.test.ts +0 -71
- package/src/utils/fetch-metadata.test.ts +0 -28
- package/src/utils/ip.test.ts +0 -255
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
2
2
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
3
3
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
4
|
-
import "../oauth2/index.mjs";
|
|
5
4
|
import { betterFetch } from "@better-fetch/fetch";
|
|
6
5
|
//#region src/social-providers/naver.ts
|
|
7
6
|
const naver = (options) => {
|
|
@@ -64,5 +63,3 @@ const naver = (options) => {
|
|
|
64
63
|
};
|
|
65
64
|
//#endregion
|
|
66
65
|
export { naver };
|
|
67
|
-
|
|
68
|
-
//# sourceMappingURL=naver.mjs.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
2
2
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
3
3
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
4
|
-
import "../oauth2/index.mjs";
|
|
5
4
|
import { betterFetch } from "@better-fetch/fetch";
|
|
6
5
|
//#region src/social-providers/notion.ts
|
|
7
6
|
const notion = (options) => {
|
|
@@ -71,5 +70,3 @@ const notion = (options) => {
|
|
|
71
70
|
};
|
|
72
71
|
//#endregion
|
|
73
72
|
export { notion };
|
|
74
|
-
|
|
75
|
-
//# sourceMappingURL=notion.mjs.map
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { logger } from "../env/logger.mjs";
|
|
2
|
-
import "../env/index.mjs";
|
|
3
2
|
import { BetterAuthError } from "../error/index.mjs";
|
|
4
3
|
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
5
4
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
6
5
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
7
|
-
import "../oauth2/index.mjs";
|
|
8
6
|
import { decodeJwt } from "jose";
|
|
9
7
|
//#region src/social-providers/paybin.ts
|
|
10
8
|
const paybin = (options) => {
|
|
@@ -81,5 +79,3 @@ const paybin = (options) => {
|
|
|
81
79
|
};
|
|
82
80
|
//#endregion
|
|
83
81
|
export { paybin };
|
|
84
|
-
|
|
85
|
-
//# sourceMappingURL=paybin.mjs.map
|
|
@@ -126,5 +126,4 @@ declare const paypal: (options: PayPalOptions) => {
|
|
|
126
126
|
options: PayPalOptions;
|
|
127
127
|
};
|
|
128
128
|
//#endregion
|
|
129
|
-
export { PayPalOptions, PayPalProfile, PayPalTokenResponse, paypal };
|
|
130
|
-
//# sourceMappingURL=paypal.d.mts.map
|
|
129
|
+
export { PayPalOptions, PayPalProfile, PayPalTokenResponse, paypal };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { logger } from "../env/logger.mjs";
|
|
2
|
-
import "../env/index.mjs";
|
|
3
2
|
import { BetterAuthError } from "../error/index.mjs";
|
|
4
3
|
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
5
|
-
import "../oauth2/index.mjs";
|
|
6
4
|
import { base64 } from "@better-auth/utils/base64";
|
|
7
5
|
import { betterFetch } from "@better-fetch/fetch";
|
|
8
6
|
import { decodeJwt } from "jose";
|
|
@@ -140,5 +138,3 @@ const paypal = (options) => {
|
|
|
140
138
|
};
|
|
141
139
|
//#endregion
|
|
142
140
|
export { paypal };
|
|
143
|
-
|
|
144
|
-
//# sourceMappingURL=paypal.mjs.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
2
2
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
3
3
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
4
|
-
import "../oauth2/index.mjs";
|
|
5
4
|
import { betterFetch } from "@better-fetch/fetch";
|
|
6
5
|
//#region src/social-providers/polar.ts
|
|
7
6
|
const polar = (options) => {
|
|
@@ -70,5 +69,3 @@ const polar = (options) => {
|
|
|
70
69
|
};
|
|
71
70
|
//#endregion
|
|
72
71
|
export { polar };
|
|
73
|
-
|
|
74
|
-
//# sourceMappingURL=polar.mjs.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
2
2
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
3
3
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
4
|
-
import "../oauth2/index.mjs";
|
|
5
4
|
import { betterFetch } from "@better-fetch/fetch";
|
|
6
5
|
//#region src/social-providers/railway.ts
|
|
7
6
|
const authorizationEndpoint = "https://backboard.railway.com/oauth/auth";
|
|
@@ -73,5 +72,3 @@ const railway = (options) => {
|
|
|
73
72
|
};
|
|
74
73
|
//#endregion
|
|
75
74
|
export { railway };
|
|
76
|
-
|
|
77
|
-
//# sourceMappingURL=railway.mjs.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { getOAuth2Tokens } from "../oauth2/utils.mjs";
|
|
2
2
|
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
3
3
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
4
|
-
import "../oauth2/index.mjs";
|
|
5
4
|
import { base64 } from "@better-auth/utils/base64";
|
|
6
5
|
import { betterFetch } from "@better-fetch/fetch";
|
|
7
6
|
//#region src/social-providers/reddit.ts
|
|
@@ -79,5 +78,3 @@ const reddit = (options) => {
|
|
|
79
78
|
};
|
|
80
79
|
//#endregion
|
|
81
80
|
export { reddit };
|
|
82
|
-
|
|
83
|
-
//# sourceMappingURL=reddit.mjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
2
2
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
3
|
-
import "../oauth2/index.mjs";
|
|
4
3
|
import { betterFetch } from "@better-fetch/fetch";
|
|
5
4
|
//#region src/social-providers/roblox.ts
|
|
6
5
|
const roblox = (options) => {
|
|
@@ -56,5 +55,3 @@ const roblox = (options) => {
|
|
|
56
55
|
};
|
|
57
56
|
//#endregion
|
|
58
57
|
export { roblox };
|
|
59
|
-
|
|
60
|
-
//# sourceMappingURL=roblox.mjs.map
|
|
@@ -76,5 +76,4 @@ declare const salesforce: (options: SalesforceOptions) => {
|
|
|
76
76
|
options: SalesforceOptions;
|
|
77
77
|
};
|
|
78
78
|
//#endregion
|
|
79
|
-
export { SalesforceOptions, SalesforceProfile, salesforce };
|
|
80
|
-
//# sourceMappingURL=salesforce.d.mts.map
|
|
79
|
+
export { SalesforceOptions, SalesforceProfile, salesforce };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { logger } from "../env/logger.mjs";
|
|
2
|
-
import "../env/index.mjs";
|
|
3
2
|
import { BetterAuthError } from "../error/index.mjs";
|
|
4
3
|
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
5
4
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
6
5
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
7
|
-
import "../oauth2/index.mjs";
|
|
8
6
|
import { betterFetch } from "@better-fetch/fetch";
|
|
9
7
|
//#region src/social-providers/salesforce.ts
|
|
10
8
|
const salesforce = (options) => {
|
|
@@ -87,5 +85,3 @@ const salesforce = (options) => {
|
|
|
87
85
|
};
|
|
88
86
|
//#endregion
|
|
89
87
|
export { salesforce };
|
|
90
|
-
|
|
91
|
-
//# sourceMappingURL=salesforce.mjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
2
2
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
3
|
-
import "../oauth2/index.mjs";
|
|
4
3
|
import { betterFetch } from "@better-fetch/fetch";
|
|
5
4
|
//#region src/social-providers/slack.ts
|
|
6
5
|
const slack = (options) => {
|
|
@@ -65,5 +64,3 @@ const slack = (options) => {
|
|
|
65
64
|
};
|
|
66
65
|
//#endregion
|
|
67
66
|
export { slack };
|
|
68
|
-
|
|
69
|
-
//# sourceMappingURL=slack.mjs.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
2
2
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
3
3
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
4
|
-
import "../oauth2/index.mjs";
|
|
5
4
|
import { betterFetch } from "@better-fetch/fetch";
|
|
6
5
|
//#region src/social-providers/spotify.ts
|
|
7
6
|
const spotify = (options) => {
|
|
@@ -68,5 +67,3 @@ const spotify = (options) => {
|
|
|
68
67
|
};
|
|
69
68
|
//#endregion
|
|
70
69
|
export { spotify };
|
|
71
|
-
|
|
72
|
-
//# sourceMappingURL=spotify.mjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
2
2
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
3
|
-
import "../oauth2/index.mjs";
|
|
4
3
|
import { betterFetch } from "@better-fetch/fetch";
|
|
5
4
|
//#region src/social-providers/tiktok.ts
|
|
6
5
|
const tiktok = (options) => {
|
|
@@ -59,5 +58,3 @@ const tiktok = (options) => {
|
|
|
59
58
|
};
|
|
60
59
|
//#endregion
|
|
61
60
|
export { tiktok };
|
|
62
|
-
|
|
63
|
-
//# sourceMappingURL=tiktok.mjs.map
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { logger } from "../env/logger.mjs";
|
|
2
|
-
import "../env/index.mjs";
|
|
3
2
|
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
4
3
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
5
4
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
6
|
-
import "../oauth2/index.mjs";
|
|
7
5
|
import { decodeJwt } from "jose";
|
|
8
6
|
//#region src/social-providers/twitch.ts
|
|
9
7
|
const twitch = (options) => {
|
|
@@ -75,5 +73,3 @@ const twitch = (options) => {
|
|
|
75
73
|
};
|
|
76
74
|
//#endregion
|
|
77
75
|
export { twitch };
|
|
78
|
-
|
|
79
|
-
//# sourceMappingURL=twitch.mjs.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
2
2
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
3
3
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
4
|
-
import "../oauth2/index.mjs";
|
|
5
4
|
import { betterFetch } from "@better-fetch/fetch";
|
|
6
5
|
//#region src/social-providers/twitter.ts
|
|
7
6
|
const twitter = (options) => {
|
|
@@ -84,5 +83,3 @@ const twitter = (options) => {
|
|
|
84
83
|
};
|
|
85
84
|
//#endregion
|
|
86
85
|
export { twitter };
|
|
87
|
-
|
|
88
|
-
//# sourceMappingURL=twitter.mjs.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BetterAuthError } from "../error/index.mjs";
|
|
2
2
|
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
3
3
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
4
|
-
import "../oauth2/index.mjs";
|
|
5
4
|
import { betterFetch } from "@better-fetch/fetch";
|
|
6
5
|
//#region src/social-providers/vercel.ts
|
|
7
6
|
const vercel = (options) => {
|
|
@@ -57,5 +56,3 @@ const vercel = (options) => {
|
|
|
57
56
|
};
|
|
58
57
|
//#endregion
|
|
59
58
|
export { vercel };
|
|
60
|
-
|
|
61
|
-
//# sourceMappingURL=vercel.mjs.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
2
2
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
3
3
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
4
|
-
import "../oauth2/index.mjs";
|
|
5
4
|
import { betterFetch } from "@better-fetch/fetch";
|
|
6
5
|
//#region src/social-providers/vk.ts
|
|
7
6
|
const vk = (options) => {
|
|
@@ -80,5 +79,3 @@ const vk = (options) => {
|
|
|
80
79
|
};
|
|
81
80
|
//#endregion
|
|
82
81
|
export { vk };
|
|
83
|
-
|
|
84
|
-
//# sourceMappingURL=vk.mjs.map
|
|
@@ -160,5 +160,4 @@ declare const zoom: (userOptions: ZoomOptions) => {
|
|
|
160
160
|
} | null>;
|
|
161
161
|
};
|
|
162
162
|
//#endregion
|
|
163
|
-
export { AccountStatus, LoginType, PhoneNumber, PronounOption, ZoomOptions, ZoomProfile, zoom };
|
|
164
|
-
//# sourceMappingURL=zoom.d.mts.map
|
|
163
|
+
export { AccountStatus, LoginType, PhoneNumber, PronounOption, ZoomOptions, ZoomProfile, zoom };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { generateCodeChallenge } from "../oauth2/utils.mjs";
|
|
2
2
|
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
3
3
|
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
4
|
-
import "../oauth2/index.mjs";
|
|
5
4
|
import { betterFetch } from "@better-fetch/fetch";
|
|
6
5
|
//#region src/social-providers/zoom.ts
|
|
7
6
|
const zoom = (userOptions) => {
|
|
@@ -68,5 +67,3 @@ const zoom = (userOptions) => {
|
|
|
68
67
|
};
|
|
69
68
|
//#endregion
|
|
70
69
|
export { zoom };
|
|
71
|
-
|
|
72
|
-
//# sourceMappingURL=zoom.mjs.map
|
package/dist/types/context.d.mts
CHANGED
|
@@ -35,6 +35,7 @@ type InferPluginOptions<O extends BetterAuthOptions, ID extends BetterAuthPlugin
|
|
|
35
35
|
*
|
|
36
36
|
* const createMyPlugin = <Options extends MyPluginOptions>(options?: Options) => ({
|
|
37
37
|
* id: 'my-plugin',
|
|
38
|
+
* version: '1.0.0',
|
|
38
39
|
* options,
|
|
39
40
|
* } satisfies BetterAuthPlugin);
|
|
40
41
|
*
|
|
@@ -49,7 +50,9 @@ type InferPluginOptions<O extends BetterAuthOptions, ID extends BetterAuthPlugin
|
|
|
49
50
|
*/
|
|
50
51
|
interface BetterAuthPluginRegistry<AuthOptions, Options> {}
|
|
51
52
|
type BetterAuthPluginRegistryIdentifier = keyof BetterAuthPluginRegistry<unknown, unknown>;
|
|
52
|
-
type GenericEndpointContext<Options extends BetterAuthOptions = BetterAuthOptions> = EndpointContext<string, any
|
|
53
|
+
type GenericEndpointContext<Options extends BetterAuthOptions = BetterAuthOptions> = EndpointContext<string, any> & {
|
|
54
|
+
context: AuthContext<Options>;
|
|
55
|
+
};
|
|
53
56
|
interface InternalAdapter<_Options extends BetterAuthOptions = BetterAuthOptions> {
|
|
54
57
|
createOAuthUser(user: Omit<User, "id" | "createdAt" | "updatedAt">, account: Omit<Account, "userId" | "id" | "createdAt" | "updatedAt"> & Partial<Account>): Promise<{
|
|
55
58
|
user: User;
|
|
@@ -271,5 +274,4 @@ type AuthContext<Options extends BetterAuthOptions = BetterAuthOptions> = Plugin
|
|
|
271
274
|
runInBackgroundOrAwait: (promise: Promise<unknown> | void) => Awaitable<unknown>;
|
|
272
275
|
};
|
|
273
276
|
//#endregion
|
|
274
|
-
export { AuthContext, BetterAuthPluginRegistry, BetterAuthPluginRegistryIdentifier, GenericEndpointContext, InfoContext, InternalAdapter, PluginContext };
|
|
275
|
-
//# sourceMappingURL=context.d.mts.map
|
|
277
|
+
export { AuthContext, BetterAuthPluginRegistry, BetterAuthPluginRegistryIdentifier, GenericEndpointContext, InfoContext, InternalAdapter, PluginContext };
|
package/dist/types/cookie.d.mts
CHANGED
package/dist/types/helper.d.mts
CHANGED
|
@@ -7,5 +7,4 @@ type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (Base
|
|
|
7
7
|
type Prettify<T> = { [K in keyof T]: T[K] } & {};
|
|
8
8
|
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
|
9
9
|
//#endregion
|
|
10
|
-
export { Awaitable, AwaitableFunction, LiteralString, LiteralUnion, Prettify, Primitive, UnionToIntersection };
|
|
11
|
-
//# sourceMappingURL=helper.d.mts.map
|
|
10
|
+
export { Awaitable, AwaitableFunction, LiteralString, LiteralUnion, Prettify, Primitive, UnionToIntersection };
|
|
@@ -165,7 +165,9 @@ type BetterAuthAdvancedOptions = {
|
|
|
165
165
|
ipv6Subnet?: 128 | 64 | 48 | 32;
|
|
166
166
|
} | undefined;
|
|
167
167
|
/**
|
|
168
|
-
*
|
|
168
|
+
* Force cookies to always use the `Secure` attribute. By default,
|
|
169
|
+
* cookies are secure in production environments. Set this to `true`
|
|
170
|
+
* to enforce secure cookies in all environments.
|
|
169
171
|
*
|
|
170
172
|
* @default false
|
|
171
173
|
*/
|
|
@@ -314,9 +316,11 @@ type BetterAuthAdvancedOptions = {
|
|
|
314
316
|
};
|
|
315
317
|
type BetterAuthOptions = {
|
|
316
318
|
/**
|
|
317
|
-
* The name of
|
|
319
|
+
* The name of your application. Used as a display name in contexts
|
|
320
|
+
* where your app needs to be identified — for example, as the default
|
|
321
|
+
* issuer name in authenticator apps when users set up 2FA/TOTP.
|
|
318
322
|
*
|
|
319
|
-
*
|
|
323
|
+
* Can also be set via the `APP_NAME` environment variable.
|
|
320
324
|
*
|
|
321
325
|
* @default "Better Auth"
|
|
322
326
|
*/
|
|
@@ -1010,7 +1014,12 @@ type BetterAuthOptions = {
|
|
|
1010
1014
|
storeInDatabase?: boolean;
|
|
1011
1015
|
}) | undefined;
|
|
1012
1016
|
/**
|
|
1013
|
-
*
|
|
1017
|
+
* Additional trusted origins. By default, Better Auth trusts your
|
|
1018
|
+
* app's {@link baseURL}. Use this option to allow additional origins
|
|
1019
|
+
* (e.g. a separate frontend domain).
|
|
1020
|
+
*
|
|
1021
|
+
* Can be a static array, a function that returns origins dynamically,
|
|
1022
|
+
* or use wildcard patterns (e.g. `"https://*.example.com"`).
|
|
1014
1023
|
*
|
|
1015
1024
|
* @param request - The request object.
|
|
1016
1025
|
* It'll be undefined if no request was
|
|
@@ -1346,5 +1355,4 @@ type BetterAuthOptions = {
|
|
|
1346
1355
|
};
|
|
1347
1356
|
};
|
|
1348
1357
|
//#endregion
|
|
1349
|
-
export { BaseURLConfig, BetterAuthAdvancedOptions, BetterAuthDBOptions, BetterAuthOptions, BetterAuthRateLimitOptions, BetterAuthRateLimitRule, BetterAuthRateLimitStorage, DynamicBaseURLConfig, GenerateIdFn, StoreIdentifierOption };
|
|
1350
|
-
//# sourceMappingURL=init-options.d.mts.map
|
|
1358
|
+
export { BaseURLConfig, BetterAuthAdvancedOptions, BetterAuthDBOptions, BetterAuthOptions, BetterAuthRateLimitOptions, BetterAuthRateLimitRule, BetterAuthRateLimitStorage, DynamicBaseURLConfig, GenerateIdFn, StoreIdentifierOption };
|
|
@@ -66,6 +66,7 @@ interface BetterAuthClientOptions {
|
|
|
66
66
|
}
|
|
67
67
|
interface BetterAuthClientPlugin {
|
|
68
68
|
id: LiteralString;
|
|
69
|
+
version?: string | undefined;
|
|
69
70
|
/**
|
|
70
71
|
* only used for type inference. don't pass the
|
|
71
72
|
* actual plugin
|
|
@@ -109,5 +110,4 @@ interface BetterAuthClientPlugin {
|
|
|
109
110
|
}>;
|
|
110
111
|
}
|
|
111
112
|
//#endregion
|
|
112
|
-
export { BetterAuthClientOptions, BetterAuthClientPlugin, ClientAtomListener, ClientFetchOption, ClientStore };
|
|
113
|
-
//# sourceMappingURL=plugin-client.d.mts.map
|
|
113
|
+
export { BetterAuthClientOptions, BetterAuthClientPlugin, ClientAtomListener, ClientFetchOption, ClientStore };
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -9,10 +9,7 @@ import { Migration } from "kysely";
|
|
|
9
9
|
|
|
10
10
|
//#region src/types/plugin.d.ts
|
|
11
11
|
type DeepPartial<T> = T extends Function ? T : T extends object ? { [K in keyof T]?: DeepPartial<T[K]> } : T;
|
|
12
|
-
type HookEndpointContext = Partial<EndpointContext<string, any
|
|
13
|
-
returned?: unknown | undefined;
|
|
14
|
-
responseHeaders?: Headers | undefined;
|
|
15
|
-
}> & Omit<InputContext<string, any, any, any, any, any>, "method">> & {
|
|
12
|
+
type HookEndpointContext = Partial<EndpointContext<string, any> & Omit<InputContext<string, any>, "method">> & {
|
|
16
13
|
path?: string;
|
|
17
14
|
context: AuthContext & {
|
|
18
15
|
returned?: unknown | undefined;
|
|
@@ -28,6 +25,7 @@ type BetterAuthPluginErrorCodePart = {
|
|
|
28
25
|
};
|
|
29
26
|
type BetterAuthPlugin = BetterAuthPluginErrorCodePart & {
|
|
30
27
|
id: LiteralString;
|
|
28
|
+
version?: string | undefined;
|
|
31
29
|
/**
|
|
32
30
|
* The init function is called when the plugin is initialized.
|
|
33
31
|
* You can return a new context or modify the existing context.
|
|
@@ -123,5 +121,4 @@ type BetterAuthPlugin = BetterAuthPluginErrorCodePart & {
|
|
|
123
121
|
};
|
|
124
122
|
};
|
|
125
123
|
//#endregion
|
|
126
|
-
export { BetterAuthPlugin, BetterAuthPluginErrorCodePart, HookEndpointContext };
|
|
127
|
-
//# sourceMappingURL=plugin.d.mts.map
|
|
124
|
+
export { BetterAuthPlugin, BetterAuthPluginErrorCodePart, HookEndpointContext };
|
package/dist/types/secret.d.mts
CHANGED
package/dist/utils/db.d.mts
CHANGED
|
@@ -6,5 +6,4 @@ import { DBFieldAttribute } from "../db/type.mjs";
|
|
|
6
6
|
*/
|
|
7
7
|
declare function filterOutputFields<T extends Record<string, unknown> | null>(data: T, additionalFields: Record<string, DBFieldAttribute> | undefined): T;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { filterOutputFields };
|
|
10
|
-
//# sourceMappingURL=db.d.mts.map
|
|
9
|
+
export { filterOutputFields };
|
package/dist/utils/db.mjs
CHANGED
|
@@ -6,5 +6,4 @@ import { InternalLogger } from "../env/logger.mjs";
|
|
|
6
6
|
*/
|
|
7
7
|
declare function deprecate<T extends (...args: any[]) => any>(fn: T, message: string, logger?: InternalLogger): T;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { deprecate };
|
|
10
|
-
//# sourceMappingURL=deprecate.d.mts.map
|
|
9
|
+
export { deprecate };
|
package/dist/utils/deprecate.mjs
CHANGED
|
@@ -10,5 +10,4 @@ type RawError<K extends string = string> = {
|
|
|
10
10
|
};
|
|
11
11
|
declare function defineErrorCodes<const T extends Record<string, string>, R extends { [K in keyof T & string]: RawError<K> }>(codes: ValidateErrorCodes<T>): R;
|
|
12
12
|
//#endregion
|
|
13
|
-
export { RawError, defineErrorCodes };
|
|
14
|
-
//# sourceMappingURL=error-codes.d.mts.map
|
|
13
|
+
export { RawError, defineErrorCodes };
|
package/dist/utils/id.d.mts
CHANGED
package/dist/utils/id.mjs
CHANGED
package/dist/utils/ip.d.mts
CHANGED
|
@@ -51,5 +51,4 @@ declare function normalizeIP(ip: string, options?: NormalizeIPOptions): string;
|
|
|
51
51
|
*/
|
|
52
52
|
declare function createRateLimitKey(ip: string, path: string): string;
|
|
53
53
|
//#endregion
|
|
54
|
-
export { createRateLimitKey, isValidIP, normalizeIP };
|
|
55
|
-
//# sourceMappingURL=ip.d.mts.map
|
|
54
|
+
export { createRateLimitKey, isValidIP, normalizeIP };
|