Added tracks/get as test-route for auth

ref #6
This commit is contained in:
Nicolai Ort 2020-12-18 17:19:02 +01:00
parent 445e96dcdf
commit b21dd6f0c0
1 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,4 @@
import { Body, Delete, Get, JsonController, OnUndefined, Param, Post, Put } from 'routing-controllers';
import { Authorized, Body, Delete, Get, JsonController, OnUndefined, Param, Post, Put } from 'routing-controllers';
import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi';
import { getConnectionManager, Repository } from 'typeorm';
import { EntityFromBody } from 'typeorm-routing-controllers-extensions';
@ -21,8 +21,9 @@ export class TrackController {
}
@Get()
@Authorized("TRACK:READ")
@ResponseSchema(ResponseTrack, { isArray: true })
@OpenAPI({ description: "Lists all tracks." })
@OpenAPI({ description: "Lists all tracks.", security: [{ "AuthToken": [] }] })
async getAll() {
let responseTracks: ResponseTrack[] = new Array<ResponseTrack>();
const tracks = await this.trackRepository.find();