mirror of
https://github.com/better-auth/better-auth.git
synced 2026-08-01 10:50:40 -05:00
fix(open-api): hide disabled paths (#2144)
This commit is contained in:
@@ -303,6 +303,7 @@ export async function generator(ctx: AuthContext, options: BetterAuthOptions) {
|
||||
};
|
||||
|
||||
Object.entries(baseEndpoints.api).forEach(([_, value]) => {
|
||||
if (ctx.options.disabledPaths?.includes(value.path)) return;
|
||||
const options = value.options as EndpointOptions;
|
||||
if (options.metadata?.SERVER_ONLY) return;
|
||||
const path = toOpenApiPath(value.path);
|
||||
@@ -376,6 +377,7 @@ export async function generator(ctx: AuthContext, options: BetterAuthOptions) {
|
||||
})
|
||||
.filter((x) => x !== null) as Endpoint[];
|
||||
Object.entries(api).forEach(([key, value]) => {
|
||||
if (ctx.options.disabledPaths?.includes(value.path)) return;
|
||||
const options = value.options as EndpointOptions;
|
||||
if (options.metadata?.SERVER_ONLY) return;
|
||||
const path = toOpenApiPath(value.path);
|
||||
|
||||
Reference in New Issue
Block a user