@better-auth/core 1.4.12-beta.1 → 1.4.12
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 +5 -5
- package/dist/api/index.d.mts +1 -1
- package/dist/context/index.d.mts +1 -1
- package/dist/db/adapter/index.d.mts +1 -1
- package/dist/db/index.d.mts +1 -1
- package/dist/{index-BHaoMSKV.d.mts → index-zgYuzZ7O.d.mts} +6 -0
- package/dist/index.d.mts +1 -1
- package/dist/oauth2/index.d.mts +1 -1
- package/dist/oauth2/index.mjs +1 -1
- package/dist/{oauth2-BjWM15hm.mjs → oauth2-COJkghlT.mjs} +1 -1
- package/dist/social-providers/index.d.mts +1 -1
- package/dist/social-providers/index.mjs +1 -1
- package/package.json +1 -1
- package/src/oauth2/create-authorization-url.ts +1 -1
- package/src/oauth2/oauth-provider.ts +6 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @better-auth/core@1.4.12
|
|
2
|
+
> @better-auth/core@1.4.12 build /home/runner/work/better-auth/better-auth/packages/core
|
|
3
3
|
> tsdown
|
|
4
4
|
|
|
5
5
|
[34mℹ[39m tsdown [2mv0.17.2[22m powered by rolldown [2mv1.0.0-beta.53[22m
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
[34mℹ[39m [2mdist/[22m[1mutils/index.mjs[22m [2m 0.26 kB[22m [2m│ gzip: 0.18 kB[22m
|
|
20
20
|
[34mℹ[39m [2mdist/[22m[1merror/index.mjs[22m [2m 0.19 kB[22m [2m│ gzip: 0.14 kB[22m
|
|
21
21
|
[34mℹ[39m [2mdist/[22m[1mindex.mjs[22m [2m 0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
22
|
-
[34mℹ[39m [2mdist/[22moauth2-
|
|
22
|
+
[34mℹ[39m [2mdist/[22moauth2-COJkghlT.mjs [2m 12.86 kB[22m [2m│ gzip: 3.16 kB[22m
|
|
23
23
|
[34mℹ[39m [2mdist/[22menv-DbssmzoK.mjs [2m 7.67 kB[22m [2m│ gzip: 2.54 kB[22m
|
|
24
24
|
[34mℹ[39m [2mdist/[22mget-tables-CMc_Emww.mjs [2m 6.76 kB[22m [2m│ gzip: 1.30 kB[22m
|
|
25
25
|
[34mℹ[39m [2mdist/[22mcontext-BGZ8V6DD.mjs [2m 4.46 kB[22m [2m│ gzip: 1.10 kB[22m
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
[34mℹ[39m [2mdist/[22m[32m[1mapi/index.d.mts[22m[39m [2m 0.26 kB[22m [2m│ gzip: 0.14 kB[22m
|
|
38
38
|
[34mℹ[39m [2mdist/[22m[32m[1masync_hooks/index.d.mts[22m[39m [2m 0.24 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
39
39
|
[34mℹ[39m [2mdist/[22m[32m[1masync_hooks/pure.index.d.mts[22m[39m [2m 0.22 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
40
|
-
[34mℹ[39m [2mdist/[22m[32mindex-
|
|
40
|
+
[34mℹ[39m [2mdist/[22m[32mindex-zgYuzZ7O.d.mts[39m [2m227.98 kB[22m [2m│ gzip: 36.00 kB[22m
|
|
41
41
|
[34mℹ[39m [2mdist/[22m[32mindex-BRBu0-5h.d.mts[39m [2m 3.31 kB[22m [2m│ gzip: 1.11 kB[22m
|
|
42
|
-
[34mℹ[39m 32 files, total: 410.
|
|
43
|
-
[32m✔[39m Build complete in [
|
|
42
|
+
[34mℹ[39m 32 files, total: 410.77 kB
|
|
43
|
+
[32m✔[39m Build complete in [32m5122ms[39m
|
package/dist/api/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as optionsMiddleware, i as createAuthMiddleware, n as AuthMiddleware, r as createAuthEndpoint, t as AuthEndpoint } from "../index-
|
|
1
|
+
import { a as optionsMiddleware, i as createAuthMiddleware, n as AuthMiddleware, r as createAuthEndpoint, t as AuthEndpoint } from "../index-zgYuzZ7O.mjs";
|
|
2
2
|
export { AuthEndpoint, AuthMiddleware, createAuthEndpoint, createAuthMiddleware, optionsMiddleware };
|
package/dist/context/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Xn as DBAdapter, f as AuthContext, tr as DBTransactionAdapter } from "../index-
|
|
1
|
+
import { Xn as DBAdapter, f as AuthContext, tr as DBTransactionAdapter } from "../index-zgYuzZ7O.mjs";
|
|
2
2
|
import { AsyncLocalStorage } from "@better-auth/core/async_hooks";
|
|
3
3
|
import { EndpointContext, InputContext } from "better-call";
|
|
4
4
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $n as DBAdapterInstance, Cr as initGetIdField, Dr as initGetDefaultFieldName, Er as initGetDefaultModelName, Jn as CleanedWhere, Qn as DBAdapterFactoryConfig, Sr as initGetModelName, Tr as initGetFieldAttributes, Xn as DBAdapter, Yn as CustomAdapter, Zn as DBAdapterDebugLogOption, ar as deepmerge, cr as createAdapter, dr as AdapterFactoryConfig, er as DBAdapterSchemaCreation, fr as AdapterFactoryCustomizeAdapterCreator, gr as CreateCustomAdapter, hr as CreateAdapterOptions, ir as Where, lr as createAdapterFactory, mr as AdapterTestDebugLogs, nr as JoinConfig, or as withApplyDefault, pr as AdapterFactoryOptions, rr as JoinOption, sr as AdapterFactory, tr as DBTransactionAdapter, ur as AdapterConfig, wr as initGetFieldName } from "../../index-
|
|
1
|
+
import { $n as DBAdapterInstance, Cr as initGetIdField, Dr as initGetDefaultFieldName, Er as initGetDefaultModelName, Jn as CleanedWhere, Qn as DBAdapterFactoryConfig, Sr as initGetModelName, Tr as initGetFieldAttributes, Xn as DBAdapter, Yn as CustomAdapter, Zn as DBAdapterDebugLogOption, ar as deepmerge, cr as createAdapter, dr as AdapterFactoryConfig, er as DBAdapterSchemaCreation, fr as AdapterFactoryCustomizeAdapterCreator, gr as CreateCustomAdapter, hr as CreateAdapterOptions, ir as Where, lr as createAdapterFactory, mr as AdapterTestDebugLogs, nr as JoinConfig, or as withApplyDefault, pr as AdapterFactoryOptions, rr as JoinOption, sr as AdapterFactory, tr as DBTransactionAdapter, ur as AdapterConfig, wr as initGetFieldName } from "../../index-zgYuzZ7O.mjs";
|
|
2
2
|
export { AdapterConfig, AdapterFactory, AdapterFactoryConfig, AdapterFactoryCustomizeAdapterCreator, AdapterFactoryOptions, AdapterTestDebugLogs, CleanedWhere, CreateAdapterOptions, CreateCustomAdapter, CustomAdapter, DBAdapter, DBAdapterDebugLogOption, DBAdapterFactoryConfig, DBAdapterInstance, DBAdapterSchemaCreation, DBTransactionAdapter, JoinConfig, JoinOption, Where, createAdapter, createAdapterFactory, deepmerge, initGetDefaultFieldName, initGetDefaultModelName, initGetFieldAttributes, initGetFieldName, initGetIdField, initGetModelName, withApplyDefault };
|
package/dist/db/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Ar as User, Br as getAuthTables, Fr as RateLimit, Gr as DBFieldType, Hr as BetterAuthDBSchema, Ir as rateLimitSchema, Jr as SecondaryStorage, Kr as DBPrimitive, Lr as Account, Mr as coreSchema, Nr as Session, Or as Verification, Pr as sessionSchema, Rr as accountSchema, Ur as DBFieldAttribute, Vr as BaseModelNames, Wr as DBFieldAttributeConfig, jr as userSchema, kr as verificationSchema, qr as ModelNames, zr as BetterAuthPluginDBSchema } from "../index-
|
|
1
|
+
import { Ar as User, Br as getAuthTables, Fr as RateLimit, Gr as DBFieldType, Hr as BetterAuthDBSchema, Ir as rateLimitSchema, Jr as SecondaryStorage, Kr as DBPrimitive, Lr as Account, Mr as coreSchema, Nr as Session, Or as Verification, Pr as sessionSchema, Rr as accountSchema, Ur as DBFieldAttribute, Vr as BaseModelNames, Wr as DBFieldAttributeConfig, jr as userSchema, kr as verificationSchema, qr as ModelNames, zr as BetterAuthPluginDBSchema } from "../index-zgYuzZ7O.mjs";
|
|
2
2
|
export { Account, BaseModelNames, BetterAuthDBSchema, BetterAuthPluginDBSchema, DBFieldAttribute, DBFieldAttributeConfig, DBFieldType, DBPrimitive, ModelNames, RateLimit, SecondaryStorage, Session, User, Verification, accountSchema, coreSchema, getAuthTables, rateLimitSchema, sessionSchema, userSchema, verificationSchema };
|
|
@@ -1121,6 +1121,12 @@ type ProviderOptions<Profile$1 extends Record<string, any> = any> = {
|
|
|
1121
1121
|
* whitelisted in the provider's dashboard.
|
|
1122
1122
|
*/
|
|
1123
1123
|
redirectURI?: string | undefined;
|
|
1124
|
+
/**
|
|
1125
|
+
* Custom authorization endpoint URL.
|
|
1126
|
+
* Use this to override the default authorization endpoint of the provider.
|
|
1127
|
+
* Useful for testing with local OAuth servers or using sandbox environments.
|
|
1128
|
+
*/
|
|
1129
|
+
authorizationEndpoint?: string | undefined;
|
|
1124
1130
|
/**
|
|
1125
1131
|
* The client key of your application
|
|
1126
1132
|
* Tiktok Social Provider uses this field instead of clientId
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { An as BetterAuthCookies, _ as BetterAuthOptions, _r as Awaitable, b as BetterAuthPlugin, br as Prettify, c as BetterAuthClientPlugin, d as ClientStore, f as AuthContext, g as BetterAuthAdvancedOptions, h as PluginContext, l as ClientAtomListener, m as InternalAdapter, o as StandardSchemaV1, p as GenericEndpointContext, s as BetterAuthClientOptions, u as ClientFetchOption, v as BetterAuthRateLimitOptions, vr as LiteralString, x as HookEndpointContext, xr as Primitive, y as GenerateIdFn, yr as LiteralUnion } from "./index-
|
|
1
|
+
import { An as BetterAuthCookies, _ as BetterAuthOptions, _r as Awaitable, b as BetterAuthPlugin, br as Prettify, c as BetterAuthClientPlugin, d as ClientStore, f as AuthContext, g as BetterAuthAdvancedOptions, h as PluginContext, l as ClientAtomListener, m as InternalAdapter, o as StandardSchemaV1, p as GenericEndpointContext, s as BetterAuthClientOptions, u as ClientFetchOption, v as BetterAuthRateLimitOptions, vr as LiteralString, x as HookEndpointContext, xr as Primitive, y as GenerateIdFn, yr as LiteralUnion } from "./index-zgYuzZ7O.mjs";
|
|
2
2
|
export { AuthContext, Awaitable, BetterAuthAdvancedOptions, BetterAuthClientOptions, BetterAuthClientPlugin, BetterAuthCookies, BetterAuthOptions, BetterAuthPlugin, BetterAuthRateLimitOptions, ClientAtomListener, ClientFetchOption, ClientStore, GenerateIdFn, GenericEndpointContext, HookEndpointContext, InternalAdapter, LiteralString, LiteralUnion, PluginContext, Prettify, Primitive, StandardSchemaV1 };
|
package/dist/oauth2/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Bn as refreshAccessToken, Fn as validateAuthorizationCode, Gn as OAuth2UserInfo, Hn as clientCredentialsToken, In as validateToken, Kn as OAuthProvider, Ln as generateCodeChallenge, Mn as verifyAccessToken, Nn as verifyJwsAccessToken, Pn as createAuthorizationCodeRequest, Rn as getOAuth2Tokens, Un as createClientCredentialsTokenRequest, Vn as createAuthorizationURL, Wn as OAuth2Tokens, jn as getJwks, qn as ProviderOptions, zn as createRefreshAccessTokenRequest } from "../index-
|
|
1
|
+
import { Bn as refreshAccessToken, Fn as validateAuthorizationCode, Gn as OAuth2UserInfo, Hn as clientCredentialsToken, In as validateToken, Kn as OAuthProvider, Ln as generateCodeChallenge, Mn as verifyAccessToken, Nn as verifyJwsAccessToken, Pn as createAuthorizationCodeRequest, Rn as getOAuth2Tokens, Un as createClientCredentialsTokenRequest, Vn as createAuthorizationURL, Wn as OAuth2Tokens, jn as getJwks, qn as ProviderOptions, zn as createRefreshAccessTokenRequest } from "../index-zgYuzZ7O.mjs";
|
|
2
2
|
export { OAuth2Tokens, OAuth2UserInfo, OAuthProvider, ProviderOptions, clientCredentialsToken, createAuthorizationCodeRequest, createAuthorizationURL, createClientCredentialsTokenRequest, createRefreshAccessTokenRequest, generateCodeChallenge, getJwks, getOAuth2Tokens, refreshAccessToken, validateAuthorizationCode, validateToken, verifyAccessToken, verifyJwsAccessToken };
|
package/dist/oauth2/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../env-DbssmzoK.mjs";
|
|
2
|
-
import { a as validateAuthorizationCode, c as refreshAccessToken, d as getOAuth2Tokens, f as clientCredentialsToken, i as createAuthorizationCodeRequest, l as createAuthorizationURL, n as verifyAccessToken, o as validateToken, p as createClientCredentialsTokenRequest, r as verifyJwsAccessToken, s as createRefreshAccessTokenRequest, t as getJwks, u as generateCodeChallenge } from "../oauth2-
|
|
2
|
+
import { a as validateAuthorizationCode, c as refreshAccessToken, d as getOAuth2Tokens, f as clientCredentialsToken, i as createAuthorizationCodeRequest, l as createAuthorizationURL, n as verifyAccessToken, o as validateToken, p as createClientCredentialsTokenRequest, r as verifyJwsAccessToken, s as createRefreshAccessTokenRequest, t as getJwks, u as generateCodeChallenge } from "../oauth2-COJkghlT.mjs";
|
|
3
3
|
|
|
4
4
|
export { clientCredentialsToken, createAuthorizationCodeRequest, createAuthorizationURL, createClientCredentialsTokenRequest, createRefreshAccessTokenRequest, generateCodeChallenge, getJwks, getOAuth2Tokens, refreshAccessToken, validateAuthorizationCode, validateToken, verifyAccessToken, verifyJwsAccessToken };
|
|
@@ -80,7 +80,7 @@ async function generateCodeChallenge(codeVerifier) {
|
|
|
80
80
|
//#endregion
|
|
81
81
|
//#region src/oauth2/create-authorization-url.ts
|
|
82
82
|
async function createAuthorizationURL({ id, options, authorizationEndpoint, state, codeVerifier, scopes, claims, redirectURI, duration, prompt, accessType, responseType, display, loginHint, hd, responseMode, additionalParams, scopeJoiner }) {
|
|
83
|
-
const url = new URL(authorizationEndpoint);
|
|
83
|
+
const url = new URL(options.authorizationEndpoint || authorizationEndpoint);
|
|
84
84
|
url.searchParams.set("response_type", responseType || "code");
|
|
85
85
|
const primaryClientId = Array.isArray(options.clientId) ? options.clientId[0] : options.clientId;
|
|
86
86
|
url.searchParams.set("client_id", primaryClientId);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as notion, $t as GoogleOptions, A as vercel, At as LinearUser, B as paybin, Bt as twitter, C as SocialProviderList, Cn as AtlassianProfile, Ct as GitlabProfile, D as socialProviders, Dn as AppleProfile, Dt as linkedin, E as socialProviderList, En as AppleOptions, Et as LinkedInProfile, F as PayPalProfile, Ft as DropboxOptions, G as NaverOptions, Gt as SpotifyProfile, H as LineOptions, Ht as TwitchProfile, I as PayPalTokenResponse, It as DropboxProfile, J as KakaoOptions, Jt as SlackProfile, K as NaverProfile, Kt as spotify, L as paypal, Lt as dropbox, M as PolarProfile, Mt as KickOptions, N as polar, Nt as KickProfile, O as VercelOptions, On as apple, Ot as LinearOptions, P as PayPalOptions, Pt as kick, Q as NotionProfile, Qt as huggingface, R as PaybinOptions, Rt as TwitterOption, S as SocialProvider, Sn as AtlassianOptions, St as GitlabOptions, T as SocialProviders, Tn as AppleNonConformUser, Tt as LinkedInOptions, U as LineUserInfo, Ut as twitch, V as LineIdTokenPayload, Vt as TwitchOptions, W as line, Wt as SpotifyOptions, X as kakao, Xt as HuggingFaceOptions, Y as KakaoProfile, Yt as slack, Z as NotionOptions, Zt as HuggingFaceProfile, _n as discord, _t as RedditProfile, an as microsoft, at as ZoomProfile, bn as cognito, bt as TiktokProfile, cn as github, ct as VkProfile, dn as figma, dt as SalesforceProfile, en as GoogleProfile, et as AccountStatus, fn as FacebookOptions, ft as salesforce, gn as DiscordProfile, gt as RedditOptions, hn as DiscordOptions, ht as roblox, in as MicrosoftOptions, it as ZoomOptions, j as PolarOptions, jt as linear, k as VercelProfile, kn as getApplePublicKey, kt as LinearProfile, ln as FigmaOptions, lt as vk, mn as facebook, mt as RobloxProfile, nn as google, nt as PhoneNumber, on as GithubOptions, ot as zoom, pn as FacebookProfile, pt as RobloxOptions, q as naver, qt as SlackOptions, rn as MicrosoftEntraIDProfile, rt as PronounOption, sn as GithubProfile, st as VkOption, tn as getGooglePublicKey, tt as LoginType, un as FigmaProfile, ut as SalesforceOptions, vn as CognitoOptions, vt as reddit, w as SocialProviderListEnum, wn as atlassian, wt as gitlab, xn as getCognitoPublicKey, xt as tiktok, yn as CognitoProfile, yt as TiktokOptions, z as PaybinProfile, zt as TwitterProfile } from "../index-
|
|
1
|
+
import { $ as notion, $t as GoogleOptions, A as vercel, At as LinearUser, B as paybin, Bt as twitter, C as SocialProviderList, Cn as AtlassianProfile, Ct as GitlabProfile, D as socialProviders, Dn as AppleProfile, Dt as linkedin, E as socialProviderList, En as AppleOptions, Et as LinkedInProfile, F as PayPalProfile, Ft as DropboxOptions, G as NaverOptions, Gt as SpotifyProfile, H as LineOptions, Ht as TwitchProfile, I as PayPalTokenResponse, It as DropboxProfile, J as KakaoOptions, Jt as SlackProfile, K as NaverProfile, Kt as spotify, L as paypal, Lt as dropbox, M as PolarProfile, Mt as KickOptions, N as polar, Nt as KickProfile, O as VercelOptions, On as apple, Ot as LinearOptions, P as PayPalOptions, Pt as kick, Q as NotionProfile, Qt as huggingface, R as PaybinOptions, Rt as TwitterOption, S as SocialProvider, Sn as AtlassianOptions, St as GitlabOptions, T as SocialProviders, Tn as AppleNonConformUser, Tt as LinkedInOptions, U as LineUserInfo, Ut as twitch, V as LineIdTokenPayload, Vt as TwitchOptions, W as line, Wt as SpotifyOptions, X as kakao, Xt as HuggingFaceOptions, Y as KakaoProfile, Yt as slack, Z as NotionOptions, Zt as HuggingFaceProfile, _n as discord, _t as RedditProfile, an as microsoft, at as ZoomProfile, bn as cognito, bt as TiktokProfile, cn as github, ct as VkProfile, dn as figma, dt as SalesforceProfile, en as GoogleProfile, et as AccountStatus, fn as FacebookOptions, ft as salesforce, gn as DiscordProfile, gt as RedditOptions, hn as DiscordOptions, ht as roblox, in as MicrosoftOptions, it as ZoomOptions, j as PolarOptions, jt as linear, k as VercelProfile, kn as getApplePublicKey, kt as LinearProfile, ln as FigmaOptions, lt as vk, mn as facebook, mt as RobloxProfile, nn as google, nt as PhoneNumber, on as GithubOptions, ot as zoom, pn as FacebookProfile, pt as RobloxOptions, q as naver, qt as SlackOptions, rn as MicrosoftEntraIDProfile, rt as PronounOption, sn as GithubProfile, st as VkOption, tn as getGooglePublicKey, tt as LoginType, un as FigmaProfile, ut as SalesforceOptions, vn as CognitoOptions, vt as reddit, w as SocialProviderListEnum, wn as atlassian, wt as gitlab, xn as getCognitoPublicKey, xt as tiktok, yn as CognitoProfile, yt as TiktokOptions, z as PaybinProfile, zt as TwitterProfile } from "../index-zgYuzZ7O.mjs";
|
|
2
2
|
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, VercelOptions, VercelProfile, VkOption, VkProfile, ZoomOptions, ZoomProfile, apple, atlassian, cognito, discord, dropbox, facebook, figma, getApplePublicKey, getCognitoPublicKey, getGooglePublicKey, 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, vercel, vk, zoom };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as logger } from "../env-DbssmzoK.mjs";
|
|
2
2
|
import "../utils-U2L7n92V.mjs";
|
|
3
3
|
import { t as BetterAuthError } from "../error-DP1xOn7P.mjs";
|
|
4
|
-
import { a as validateAuthorizationCode, c as refreshAccessToken, d as getOAuth2Tokens, l as createAuthorizationURL, u as generateCodeChallenge } from "../oauth2-
|
|
4
|
+
import { a as validateAuthorizationCode, c as refreshAccessToken, d as getOAuth2Tokens, l as createAuthorizationURL, u as generateCodeChallenge } from "../oauth2-COJkghlT.mjs";
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { base64 } from "@better-auth/utils/base64";
|
|
7
7
|
import { betterFetch } from "@better-fetch/fetch";
|
package/package.json
CHANGED
|
@@ -40,7 +40,7 @@ export async function createAuthorizationURL({
|
|
|
40
40
|
additionalParams?: Record<string, string> | undefined;
|
|
41
41
|
scopeJoiner?: string | undefined;
|
|
42
42
|
}) {
|
|
43
|
-
const url = new URL(authorizationEndpoint);
|
|
43
|
+
const url = new URL(options.authorizationEndpoint || authorizationEndpoint);
|
|
44
44
|
url.searchParams.set("response_type", responseType || "code");
|
|
45
45
|
const primaryClientId = Array.isArray(options.clientId)
|
|
46
46
|
? options.clientId[0]
|
|
@@ -119,6 +119,12 @@ export type ProviderOptions<Profile extends Record<string, any> = any> = {
|
|
|
119
119
|
* whitelisted in the provider's dashboard.
|
|
120
120
|
*/
|
|
121
121
|
redirectURI?: string | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* Custom authorization endpoint URL.
|
|
124
|
+
* Use this to override the default authorization endpoint of the provider.
|
|
125
|
+
* Useful for testing with local OAuth servers or using sandbox environments.
|
|
126
|
+
*/
|
|
127
|
+
authorizationEndpoint?: string | undefined;
|
|
122
128
|
/**
|
|
123
129
|
* The client key of your application
|
|
124
130
|
* Tiktok Social Provider uses this field instead of clientId
|