# Decorator AuthOptions

Decorator operation private
Module
import { AuthOptions } from "@tsed/platform/platform-middlewares/src/decorators/authOptions"
Source/packages/platform/platform-middlewares/src/decorators/authOptions.ts

# Overview

function AuthOptions(guardAuth: Type<any>, options?: IAuthOptions): Function;
Param Type Description
options IAuthOptions 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

Other topics