UNPKG

@tsed/common

Version:
43 lines (42 loc) 974 B
import { Type } from "@tsed/core"; export interface IAuthOptions { /** * @deprecated Since v6. Use @Returns from @tsed/schema */ responses?: { [statusCode: string]: { description: string; }; }; /** * @deprecated Since v6. Use @Security from @tsed/schema */ security?: { [securityName: string]: string[]; }[] | { [securityName: string]: string[]; }; [key: string]: any; } /** * Change authentication options. * * ```typescript * @Controller('/mypath') * @UseAuth(MyAuthStrategy, {role: ''}) * class MyCtrl { * * @Get('/') * @AuthOptions(MyAuthStrategy, {role: 'admin'}) * public getResource(){} * } * ``` * * @param guardAuth * @param options {Object} Object passed to the customer auth strategy * @returns {Function} * @decorator * @decorator * @operation */ export declare function AuthOptions(guardAuth: Type<any>, options?: IAuthOptions): Function;