parent
bd0c7ce042
commit
2a1b65f424
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue