🚧 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 { Body, JsonController, Post } from 'routing-controllers';
|
||||||
import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi';
|
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 { UserNotFoundError } from '../errors/UserErrors';
|
||||||
import { CreateAuth } from '../models/creation/CreateAuth';
|
import { CreateAuth } from '../models/creation/CreateAuth';
|
||||||
import { RefreshAuth } from '../models/creation/RefreshAuth';
|
import { RefreshAuth } from '../models/creation/RefreshAuth';
|
||||||
@ -29,8 +29,10 @@ export class AuthController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Post("/refresh")
|
@Post("/refresh")
|
||||||
@ResponseSchema(InvalidCredentialsError)
|
@ResponseSchema(JwtNotProvidedError)
|
||||||
|
@ResponseSchema(IllegalJWTError)
|
||||||
@ResponseSchema(UserNotFoundError)
|
@ResponseSchema(UserNotFoundError)
|
||||||
|
@ResponseSchema(RefreshTokenCountInvalidError)
|
||||||
@OpenAPI({ description: 'refresh a access token' })
|
@OpenAPI({ description: 'refresh a access token' })
|
||||||
async refresh(@Body({ validate: true }) refreshAuth: RefreshAuth) {
|
async refresh(@Body({ validate: true }) refreshAuth: RefreshAuth) {
|
||||||
let auth;
|
let auth;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user