diff --git a/src/controllers/AuthController.ts b/src/controllers/AuthController.ts index 8a39093..afa677b 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 } from '../errors/AuthError'; +import { InvalidCredentialsError, PasswordNeededError, UsernameOrEmailNeededError } from '../errors/AuthError'; import { UserNotFoundError } from '../errors/UserErrors'; import { CreateAuth } from '../models/creation/CreateAuth'; @@ -12,6 +12,9 @@ export class AuthController { @Post("/login") @ResponseSchema(InvalidCredentialsError) @ResponseSchema(UserNotFoundError) + @ResponseSchema(UsernameOrEmailNeededError) + @ResponseSchema(PasswordNeededError) + @ResponseSchema(InvalidCredentialsError) @OpenAPI({ description: 'Create a new access token object' }) async post(@Body({ validate: true }) createAuth: CreateAuth) { let auth;