@elysiajs/bearer
Version:
Elysia Pplugin for retreiving Bearer token
61 lines (60 loc) • 1.39 kB
TypeScript
import { Elysia } from 'elysia';
export interface BearerOptions {
/**
* If the API doesn't compliant with RFC6750
* The key for extracting the token is configurable
*/
extract: {
/**
* Determined which fields to be identified as Bearer token
*
* @default access_token
*/
body?: string;
/**
* Determined which fields to be identified as Bearer token
*
* @default access_token
*/
query?: string;
/**
* Determined which type of Authentication should be Bearer token
*
* @default Bearer
*/
header?: string;
};
}
export declare const bearer: ({ extract: { body, query: queryName, header } }?: BearerOptions) => Elysia<"", {
decorator: {};
store: {};
derive: {
readonly bearer: string | undefined;
};
resolve: {};
}, {
typebox: {};
error: {};
}, {
schema: {};
standaloneSchema: {};
macro: {};
macroFn: {};
parser: {};
response: import("elysia").ExtractErrorFromHandle<{
readonly bearer: string | undefined;
}>;
}, {}, {
derive: {};
resolve: {};
schema: {};
standaloneSchema: {};
response: {};
}, {
derive: {};
resolve: {};
schema: {};
standaloneSchema: {};
response: {};
}>;
export default bearer;