# AuthOptions Decorator operation
Module | import { AuthOptions } from "@tsed/common" |
---|---|
Source | /packages/common/src/mvc/decorators/method/authOptions.ts |
# Overview
function AuthOptions(guardAuth: Type<any>, options?: IAuthOptions): Function;
Param | Type | Description |
---|---|---|
options | Object | Optional. Object passed to the customer auth strategy |
# Description
Change authentication options.
@Controller('/mypath')
@UseAuth(MyAuthStrategy, {role: ''})
class MyCtrl {
@Get('/')
@AuthOptions(MyAuthStrategy, {role: 'admin'})
public getResource(){}
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
- Session & cookies
- Passport.js
- TypeORM
- Mongoose
- GraphQL
- Socket.io
- Swagger
- AJV
- Multer
- Serve static files
- Templating
- Throw HTTP Exceptions
- Customize 404
- AWS
- Jest
- Seq
- Controllers
- Providers
- Model
- Converters
- Middlewares
- Pipes
- Interceptors
- Authentication
- Hooks
- Injection scopes
- Custom providers
- Custom endpoint decorator
- Testing