@elysiajs/bearer
Version:
Plugin for Elysia for retreiving Bearer token
53 lines (52 loc) • 1.19 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: any;
};
resolve: {};
}, {
typebox: import("@sinclair/typebox").TModule<{}>;
error: {};
}, {
schema: {};
macro: {};
macroFn: {};
parser: {};
}, {}, {
derive: {};
resolve: {};
schema: {};
}, {
derive: {};
resolve: {};
schema: {};
}>;
export default bearer;