chore: user setting module
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
import { Body, Controller, HttpCode, HttpStatus, Post, UseGuards } from "@nestjs/common";
|
||||
import { Body, Controller, HttpCode, HttpStatus, Patch, Post, UseGuards } from "@nestjs/common";
|
||||
import { ApiOperation, ApiTags } from "@nestjs/swagger";
|
||||
import { Throttle, ThrottlerGuard } from "@nestjs/throttler";
|
||||
|
||||
import { CompleteRegistrationDto } from "./DTO/complete-register.dto";
|
||||
import { CheckUserExistDto, LoginPasswordDTO } from "./DTO/loginPassword.dto";
|
||||
import { RequestOtpDto } from "./DTO/request-otp.dto";
|
||||
import { UpdatePasswordDto } from "./DTO/update-password.dto";
|
||||
import { VerifyOtpDto } from "./DTO/verify-otp.dto";
|
||||
import { AuthService } from "./providers/auth.service";
|
||||
import { AUTH_THROTTLE_LIMIT, AUTH_THROTTLE_TTL } from "../../common/constants";
|
||||
import { AuthGuards } from "../../common/decorators/auth-guard.decorator";
|
||||
import { UserDec } from "../../common/decorators/user.decorator";
|
||||
import { User } from "../users/entities/user.entity";
|
||||
|
||||
@ApiTags("Auth")
|
||||
@Controller("auth")
|
||||
@@ -71,6 +75,14 @@ export class AuthController {
|
||||
adminVerifyOtp(@Body() verifyOtpDto: VerifyOtpDto) {
|
||||
return this.authService.adminVerifyLoginOtp(verifyOtpDto);
|
||||
}
|
||||
|
||||
@AuthGuards()
|
||||
@ApiOperation({ summary: "Update user password" })
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@Patch("password")
|
||||
updatePassword(@UserDec() user: User, @Body() updatePasswordDto: UpdatePasswordDto) {
|
||||
return this.authService.updatePassword(user.id, updatePasswordDto);
|
||||
}
|
||||
//***************************** */
|
||||
|
||||
// @Post("forgot-password")
|
||||
|
||||
Reference in New Issue
Block a user