Browse Source
Replace the existing configuration context type with a new structure that includes an authentication context. The updated context now provides methods for global and user configuration retrieval, enhancing the overall configuration management within the application. The previous config-context.d.ts file has been removed as part of this update.feat/auth-access-control
2 changed files with 11 additions and 17 deletions
@ -1,17 +0,0 @@ |
|||
import type { KnownConfigKey, KnownConfigValue } from "../service/config/registry"; |
|||
|
|||
declare module "h3" { |
|||
interface H3EventContext { |
|||
auth: { |
|||
getCurrent: () => Promise<{ id: number; username: string } | null>; |
|||
requireUser: () => Promise<{ id: number; username: string }>; |
|||
}; |
|||
config: { |
|||
getGlobal: <K extends KnownConfigKey>(key: K) => Promise<KnownConfigValue<K>>; |
|||
getUser: <K extends KnownConfigKey>(key: K) => Promise<KnownConfigValue<K> | undefined>; |
|||
get: <K extends KnownConfigKey>(key: K) => Promise<KnownConfigValue<K>>; |
|||
}; |
|||
} |
|||
} |
|||
|
|||
export {}; |
|||
Loading…
Reference in new issue