mirror of
https://github.com/better-auth/better-auth.git
synced 2026-10-19 11:24:57 -05:00
fix(oauth-provider): fix dist declaration type errors (#8701)
This commit is contained in:
committed by
Alex Yang
parent
0cfd514a3d
commit
ec79fa2750
@@ -32,11 +32,14 @@ export const oauthProviderResourceClient = <T extends Auth | undefined>(
|
||||
}
|
||||
return jwtPlugin?.options;
|
||||
};
|
||||
const getAuthorizationServer = async () => {
|
||||
const authServerBaseUrl =
|
||||
typeof auth?.options.baseURL === "string"
|
||||
? auth.options.baseURL
|
||||
: undefined;
|
||||
const getAuthorizationServer = async (): Promise<string | undefined> => {
|
||||
const jwtPluginOptions = await getJwtPluginOptions();
|
||||
return jwtPluginOptions?.jwt?.issuer ?? authServerBaseUrl;
|
||||
};
|
||||
const authServerBaseUrl = auth?.options.baseURL;
|
||||
const authServerBasePath = auth?.options.basePath;
|
||||
|
||||
return {
|
||||
|
||||
@@ -120,7 +120,7 @@ export async function consentEndpoint(
|
||||
}
|
||||
ctx?.headers?.set("accept", "application/json");
|
||||
ctx.query = deleteFromPrompt(query, "consent");
|
||||
ctx.context.postLogin = true;
|
||||
(ctx.context as Record<string, unknown>).postLogin = true;
|
||||
const { url } = await authorizeEndpoint(ctx, opts);
|
||||
return {
|
||||
redirect: true,
|
||||
|
||||
@@ -446,7 +446,7 @@ export function schemaToOAuth(input: SchemaClient<Scope[]>): OAuthClient {
|
||||
software_version: softwareVersion ?? undefined,
|
||||
software_statement: softwareStatement ?? undefined,
|
||||
// Authentication Metadata
|
||||
redirect_uris: redirectUris ?? undefined,
|
||||
redirect_uris: redirectUris ?? [],
|
||||
post_logout_redirect_uris: postLogoutRedirectUris ?? undefined,
|
||||
token_endpoint_auth_method: tokenEndpointAuthMethod ?? undefined,
|
||||
grant_types: grantTypes ?? undefined,
|
||||
|
||||
@@ -55,7 +55,7 @@ export const getOAuthProviderPlugin = (ctx: AuthContext) => {
|
||||
export const getJwtPlugin = (ctx: AuthContext) => {
|
||||
const plugin = ctx.getPlugin("jwt") satisfies ReturnType<typeof jwt> | null;
|
||||
if (!plugin) {
|
||||
throw new BetterAuthError("jwt_config", "jwt plugin not found");
|
||||
throw new BetterAuthError("jwt_config");
|
||||
}
|
||||
return plugin;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user