Authenticated Decorator

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

Overview

function Authenticated(options?: any): Function;

Description

Set authentication strategy on your endpoint.

@ControllerProvider('/mypath')
class MyCtrl {

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