🚧 AuthController - add proper response schemas
This commit is contained in:
parent
e5f65d0b80
commit
0d21497c2f
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue