parent
bd0c7ce042
commit
2a1b65f424
@ -1,6 +1,6 @@
|
|||||||
import { Body, JsonController, Post } from 'routing-controllers';
|
import { Body, JsonController, Post } from 'routing-controllers';
|
||||||
import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi';
|
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 { UserNotFoundError } from '../errors/UserErrors';
|
||||||
import { CreateAuth } from '../models/creation/CreateAuth';
|
import { CreateAuth } from '../models/creation/CreateAuth';
|
||||||
|
|
||||||
@ -12,6 +12,9 @@ export class AuthController {
|
|||||||
@Post("/login")
|
@Post("/login")
|
||||||
@ResponseSchema(InvalidCredentialsError)
|
@ResponseSchema(InvalidCredentialsError)
|
||||||
@ResponseSchema(UserNotFoundError)
|
@ResponseSchema(UserNotFoundError)
|
||||||
|
@ResponseSchema(UsernameOrEmailNeededError)
|
||||||
|
@ResponseSchema(PasswordNeededError)
|
||||||
|
@ResponseSchema(InvalidCredentialsError)
|
||||||
@OpenAPI({ description: 'Create a new access token object' })
|
@OpenAPI({ description: 'Create a new access token object' })
|
||||||
async post(@Body({ validate: true }) createAuth: CreateAuth) {
|
async post(@Body({ validate: true }) createAuth: CreateAuth) {
|
||||||
let auth;
|
let auth;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user