AuthOptions
@tsed/platform-middlewares
Usage
typescript
import { AuthOptions } from "@tsed/platform-middlewares";
See /packages/platform/platform-middlewares/src/types/decorators/authOptions.ts.
Overview
ts
function AuthOptions(guardAuth: Type<any>, options?: Record<string, unknown>): Function;
- options (
Record<string
): Optional. Object passed to the customer auth strategy
Description
Change authentication options.
typescript
@Controller('/mypath')
@UseAuth(MyAuthStrategy, {role: ''})
class MyCtrl {
@Get('/')
@AuthOptions(MyAuthStrategy, {role: 'admin'})
public getResource(){}
}