|
|
|
|
@ -49,22 +49,22 @@ export class AuthController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Post('validateToken')
|
|
|
|
|
@HttpCode(HttpStatus.OK)
|
|
|
|
|
@Authenticated()
|
|
|
|
|
@HttpCode(HttpStatus.OK)
|
|
|
|
|
validateAccessToken(): ValidateAccessTokenResponseDto {
|
|
|
|
|
return { authStatus: true };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Post('change-password')
|
|
|
|
|
@HttpCode(HttpStatus.OK)
|
|
|
|
|
@Authenticated({ permission: Permission.AuthChangePassword })
|
|
|
|
|
@HttpCode(HttpStatus.OK)
|
|
|
|
|
changePassword(@Auth() auth: AuthDto, @Body() dto: ChangePasswordDto): Promise<UserAdminResponseDto> {
|
|
|
|
|
return this.service.changePassword(auth, dto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Post('logout')
|
|
|
|
|
@HttpCode(HttpStatus.OK)
|
|
|
|
|
@Authenticated()
|
|
|
|
|
@HttpCode(HttpStatus.OK)
|
|
|
|
|
async logout(
|
|
|
|
|
@Req() request: Request,
|
|
|
|
|
@Res({ passthrough: true }) res: Response,
|
|
|
|
|
@ -88,32 +88,35 @@ export class AuthController {
|
|
|
|
|
|
|
|
|
|
@Post('pin-code')
|
|
|
|
|
@Authenticated({ permission: Permission.PinCodeCreate })
|
|
|
|
|
@HttpCode(HttpStatus.NO_CONTENT)
|
|
|
|
|
setupPinCode(@Auth() auth: AuthDto, @Body() dto: PinCodeSetupDto): Promise<void> {
|
|
|
|
|
return this.service.setupPinCode(auth, dto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Put('pin-code')
|
|
|
|
|
@Authenticated({ permission: Permission.PinCodeUpdate })
|
|
|
|
|
@HttpCode(HttpStatus.NO_CONTENT)
|
|
|
|
|
async changePinCode(@Auth() auth: AuthDto, @Body() dto: PinCodeChangeDto): Promise<void> {
|
|
|
|
|
return this.service.changePinCode(auth, dto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Delete('pin-code')
|
|
|
|
|
@Authenticated({ permission: Permission.PinCodeDelete })
|
|
|
|
|
@HttpCode(HttpStatus.NO_CONTENT)
|
|
|
|
|
async resetPinCode(@Auth() auth: AuthDto, @Body() dto: PinCodeResetDto): Promise<void> {
|
|
|
|
|
return this.service.resetPinCode(auth, dto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Post('session/unlock')
|
|
|
|
|
@HttpCode(HttpStatus.OK)
|
|
|
|
|
@Authenticated()
|
|
|
|
|
@HttpCode(HttpStatus.NO_CONTENT)
|
|
|
|
|
async unlockAuthSession(@Auth() auth: AuthDto, @Body() dto: SessionUnlockDto): Promise<void> {
|
|
|
|
|
return this.service.unlockSession(auth, dto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Post('session/lock')
|
|
|
|
|
@HttpCode(HttpStatus.OK)
|
|
|
|
|
@Authenticated()
|
|
|
|
|
@HttpCode(HttpStatus.NO_CONTENT)
|
|
|
|
|
async lockAuthSession(@Auth() auth: AuthDto): Promise<void> {
|
|
|
|
|
return this.service.lockSession(auth);
|
|
|
|
|
}
|
|
|
|
|
|