parent
3deae2bfeb
commit
ac00667465
|
@ -7,7 +7,7 @@ import { CreateResetToken } from '../models/actions/create/CreateResetToken';
|
|||
import { HandleLogout } from '../models/actions/HandleLogout';
|
||||
import { RefreshAuth } from '../models/actions/RefreshAuth';
|
||||
import { ResetPassword } from '../models/actions/ResetPassword';
|
||||
import { Auth } from '../models/responses/ResponseAuth';
|
||||
import { ResponseAuth } from '../models/responses/ResponseAuth';
|
||||
import { Logout } from '../models/responses/ResponseLogout';
|
||||
|
||||
@JsonController('/auth')
|
||||
|
@ -16,7 +16,7 @@ export class AuthController {
|
|||
}
|
||||
|
||||
@Post("/login")
|
||||
@ResponseSchema(Auth)
|
||||
@ResponseSchema(ResponseAuth)
|
||||
@ResponseSchema(InvalidCredentialsError)
|
||||
@ResponseSchema(UserNotFoundError)
|
||||
@ResponseSchema(UsernameOrEmailNeededError)
|
||||
|
@ -60,7 +60,7 @@ export class AuthController {
|
|||
}
|
||||
|
||||
@Post("/refresh")
|
||||
@ResponseSchema(Auth)
|
||||
@ResponseSchema(ResponseAuth)
|
||||
@ResponseSchema(JwtNotProvidedError)
|
||||
@ResponseSchema(IllegalJWTError)
|
||||
@ResponseSchema(UserNotFoundError)
|
||||
|
@ -82,7 +82,7 @@ export class AuthController {
|
|||
}
|
||||
|
||||
@Post("/reset")
|
||||
@ResponseSchema(Auth)
|
||||
@ResponseSchema(ResponseAuth)
|
||||
@ResponseSchema(UserNotFoundError)
|
||||
@ResponseSchema(UsernameOrEmailNeededError)
|
||||
@OpenAPI({ description: "Request a password reset token. <br> This will provide you with a reset token that you can use by posting to /api/auth/reset/{token}." })
|
||||
|
@ -92,7 +92,7 @@ export class AuthController {
|
|||
}
|
||||
|
||||
@Post("/reset/:token")
|
||||
@ResponseSchema(Auth)
|
||||
@ResponseSchema(ResponseAuth)
|
||||
@ResponseSchema(UserNotFoundError)
|
||||
@ResponseSchema(UsernameOrEmailNeededError)
|
||||
@OpenAPI({ description: "Reset a user's utilising a valid password reset token. <br> This will set the user's password to the one you provided in the body. <br> To get a reset token post to /api/auth/reset with your username." })
|
||||
|
|
|
@ -3,7 +3,7 @@ import { IsInt, IsString } from 'class-validator';
|
|||
/**
|
||||
* Defines the repsonse auth.
|
||||
*/
|
||||
export class Auth {
|
||||
export class ResponseAuth {
|
||||
/**
|
||||
* The access_token - JWT shortterm access token.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue