From 0d21497c2fd42602d253067d6f6d42fe7cfee5b5 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sat, 5 Dec 2020 13:31:46 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20AuthController=20-=20add=20prope?= =?UTF-8?q?r=20response=20schemas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/AuthController.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controllers/AuthController.ts b/src/controllers/AuthController.ts index d14e574..2264ba5 100644 --- a/src/controllers/AuthController.ts +++ b/src/controllers/AuthController.ts @@ -1,6 +1,6 @@ import { Body, JsonController, Post } from 'routing-controllers'; import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi'; -import { InvalidCredentialsError, PasswordNeededError, UsernameOrEmailNeededError } from '../errors/AuthError'; +import { IllegalJWTError, InvalidCredentialsError, JwtNotProvidedError, PasswordNeededError, RefreshTokenCountInvalidError, UsernameOrEmailNeededError } from '../errors/AuthError'; import { UserNotFoundError } from '../errors/UserErrors'; import { CreateAuth } from '../models/creation/CreateAuth'; import { RefreshAuth } from '../models/creation/RefreshAuth'; @@ -29,8 +29,10 @@ export class AuthController { } @Post("/refresh") - @ResponseSchema(InvalidCredentialsError) + @ResponseSchema(JwtNotProvidedError) + @ResponseSchema(IllegalJWTError) @ResponseSchema(UserNotFoundError) + @ResponseSchema(RefreshTokenCountInvalidError) @OpenAPI({ description: 'refresh a access token' }) async refresh(@Body({ validate: true }) refreshAuth: RefreshAuth) { let auth;