Authenticated Decorator

Module
import { Authenticated } from "@tsed/common"
Source/packages/common/src/mvc/decorators/method/authenticated.ts

Overview

function Authenticated(options?: IAuthOptions): Function;

Description

Use passport authentication strategy on your endpoint.

@Controller('/mypath')
class MyCtrl {

  @Get('/')
  @Authenticated({role: 'admin'})
  public getResource(){}
}
1
2
3
4
5
6
7