mirror of
https://github.com/better-auth/better-auth.git
synced 2026-10-20 20:26:55 -05:00
chore(api-key): clean up api-key code (#8436)
Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
committed by
Alex Yang
co-authored by
Alex Yang
parent
9d9cd0dd76
commit
bdba7263da
@@ -380,8 +380,7 @@ export function apiKey(
|
||||
deleteAllExpiredApiKeys: routes.deleteAllExpiredApiKeys,
|
||||
},
|
||||
schema,
|
||||
configurations,
|
||||
} satisfies BetterAuthPlugin & { configurations: PredefinedApiKeyOptions[] };
|
||||
} satisfies BetterAuthPlugin;
|
||||
}
|
||||
|
||||
export type * from "./types";
|
||||
|
||||
@@ -32,11 +32,12 @@ interface Member {
|
||||
function getOrgOptions(
|
||||
ctx: GenericEndpointContext,
|
||||
): OrganizationOptions | null {
|
||||
if (ctx.context.orgOptions) {
|
||||
return ctx.context.orgOptions as OrganizationOptions;
|
||||
const context = ctx.context;
|
||||
if ("orgOptions" in context && context.orgOptions) {
|
||||
return context.orgOptions as OrganizationOptions;
|
||||
}
|
||||
|
||||
const orgPlugin = ctx.context.getPlugin?.("organization");
|
||||
const orgPlugin = context.getPlugin?.("organization");
|
||||
if (orgPlugin && "options" in orgPlugin) {
|
||||
return orgPlugin.options as OrganizationOptions;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user