fix: remove auth guard from the user verify email route
This commit is contained in:
@@ -26,12 +26,12 @@ import { VerifyOtpDto } from "../auth/DTO/verify-otp.dto";
|
|||||||
|
|
||||||
@Controller("users")
|
@Controller("users")
|
||||||
@ApiTags("users")
|
@ApiTags("users")
|
||||||
@AuthGuards()
|
|
||||||
export class UsersController {
|
export class UsersController {
|
||||||
constructor(private usersService: UsersService) {}
|
constructor(private usersService: UsersService) {}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ApiOperation({ summary: "Get user profile" })
|
@ApiOperation({ summary: "Get user profile" })
|
||||||
|
@AuthGuards()
|
||||||
@Get("me")
|
@Get("me")
|
||||||
getMe(@UserDec("id") userId: string) {
|
getMe(@UserDec("id") userId: string) {
|
||||||
return this.usersService.getMe(userId);
|
return this.usersService.getMe(userId);
|
||||||
@@ -39,17 +39,21 @@ export class UsersController {
|
|||||||
|
|
||||||
//
|
//
|
||||||
@ApiOperation({ summary: "Get user financial info" })
|
@ApiOperation({ summary: "Get user financial info" })
|
||||||
|
@AuthGuards()
|
||||||
@Get("me/financial-info")
|
@Get("me/financial-info")
|
||||||
getFinancialInfo(@UserDec("id") userId: string) {
|
getFinancialInfo(@UserDec("id") userId: string) {
|
||||||
return this.usersService.getMyFinancialInfo(userId);
|
return this.usersService.getMyFinancialInfo(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation({ summary: "Update user profile" })
|
@ApiOperation({ summary: "Update user profile" })
|
||||||
|
@AuthGuards()
|
||||||
@Patch("update-profile")
|
@Patch("update-profile")
|
||||||
updateProfile(@Body() updateProfileDto: UpdateProfileDto, @UserDec("id") userId: string) {
|
updateProfile(@Body() updateProfileDto: UpdateProfileDto, @UserDec("id") userId: string) {
|
||||||
return this.usersService.updateProfile(userId, updateProfileDto);
|
return this.usersService.updateProfile(userId, updateProfileDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation({ summary: "change user email" })
|
@ApiOperation({ summary: "change user email" })
|
||||||
|
@AuthGuards()
|
||||||
@Patch("change-email")
|
@Patch("change-email")
|
||||||
changeEmail(@Body() changeEmailDto: ChangeEmailDto, @UserDec("id") userId: string) {
|
changeEmail(@Body() changeEmailDto: ChangeEmailDto, @UserDec("id") userId: string) {
|
||||||
return this.usersService.changeEmail(userId, changeEmailDto);
|
return this.usersService.changeEmail(userId, changeEmailDto);
|
||||||
@@ -60,19 +64,24 @@ export class UsersController {
|
|||||||
verifyEmail(@Query() queryDto: EmailVerifyQueryDto, @Res({ passthrough: true }) rep: FastifyReply) {
|
verifyEmail(@Query() queryDto: EmailVerifyQueryDto, @Res({ passthrough: true }) rep: FastifyReply) {
|
||||||
return this.usersService.verifyEmail(queryDto, rep);
|
return this.usersService.verifyEmail(queryDto, rep);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation({ summary: "change user phone" })
|
@ApiOperation({ summary: "change user phone" })
|
||||||
|
@AuthGuards()
|
||||||
@Patch("change-phone")
|
@Patch("change-phone")
|
||||||
changePhone(@Body() changeDto: RequestOtpDto, @UserDec("id") userId: string) {
|
changePhone(@Body() changeDto: RequestOtpDto, @UserDec("id") userId: string) {
|
||||||
return this.usersService.changePhone(userId, changeDto);
|
return this.usersService.changePhone(userId, changeDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation({ summary: "Verify phone" })
|
@ApiOperation({ summary: "Verify phone" })
|
||||||
|
@AuthGuards()
|
||||||
@HttpCode(HttpStatus.OK)
|
@HttpCode(HttpStatus.OK)
|
||||||
@Patch("verify-phone")
|
@Patch("verify-phone")
|
||||||
verifyPhone(@Body() verifyOtpDto: VerifyOtpDto, @UserDec("id") userId: string) {
|
verifyPhone(@Body() verifyOtpDto: VerifyOtpDto, @UserDec("id") userId: string) {
|
||||||
return this.usersService.verifyPhone(verifyOtpDto, userId);
|
return this.usersService.verifyPhone(verifyOtpDto, userId);
|
||||||
}
|
}
|
||||||
|
//
|
||||||
@ApiOperation({ summary: "Check validity of user field" })
|
@ApiOperation({ summary: "Check validity of user field" })
|
||||||
|
@AuthGuards()
|
||||||
@HttpCode(HttpStatus.OK)
|
@HttpCode(HttpStatus.OK)
|
||||||
@Post("check-validity")
|
@Post("check-validity")
|
||||||
checkValidity(@Body() checkValidityDto: CheckValidityDTO, @UserDec("id") userId: string) {
|
checkValidity(@Body() checkValidityDto: CheckValidityDTO, @UserDec("id") userId: string) {
|
||||||
@@ -80,6 +89,7 @@ export class UsersController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation({ summary: "Create user group ==> admin route" })
|
@ApiOperation({ summary: "Create user group ==> admin route" })
|
||||||
|
@AuthGuards()
|
||||||
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
||||||
@Post("user-group")
|
@Post("user-group")
|
||||||
createUserGroup(@Body() createDto: CreateUserGroupDto) {
|
createUserGroup(@Body() createDto: CreateUserGroupDto) {
|
||||||
@@ -87,6 +97,7 @@ export class UsersController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation({ summary: "get all user group ==> admin route" })
|
@ApiOperation({ summary: "get all user group ==> admin route" })
|
||||||
|
@AuthGuards()
|
||||||
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
||||||
@Get("user-group")
|
@Get("user-group")
|
||||||
UserGroups() {
|
UserGroups() {
|
||||||
@@ -94,6 +105,7 @@ export class UsersController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation({ summary: "get all users ==> admin route" })
|
@ApiOperation({ summary: "get all users ==> admin route" })
|
||||||
|
@AuthGuards()
|
||||||
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
||||||
@Get()
|
@Get()
|
||||||
Users() {
|
Users() {
|
||||||
@@ -101,6 +113,7 @@ export class UsersController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation({ summary: "get all customers ==> admin route" })
|
@ApiOperation({ summary: "get all customers ==> admin route" })
|
||||||
|
@AuthGuards()
|
||||||
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
||||||
@Get("customers")
|
@Get("customers")
|
||||||
customers(@Query() queryDto: SearchCustomersDto) {
|
customers(@Query() queryDto: SearchCustomersDto) {
|
||||||
@@ -108,6 +121,7 @@ export class UsersController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation({ summary: "get all customers ==> admin route" })
|
@ApiOperation({ summary: "get all customers ==> admin route" })
|
||||||
|
@AuthGuards()
|
||||||
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
||||||
@Get("customers/:id")
|
@Get("customers/:id")
|
||||||
customer(@Param() paramDto: ParamDto) {
|
customer(@Param() paramDto: ParamDto) {
|
||||||
@@ -115,6 +129,7 @@ export class UsersController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation({ summary: "get all admins ==> admin route" })
|
@ApiOperation({ summary: "get all admins ==> admin route" })
|
||||||
|
@AuthGuards()
|
||||||
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
||||||
@Get("admins")
|
@Get("admins")
|
||||||
getAdmins(@Query() queryDto: SearchAdminQueryDto) {
|
getAdmins(@Query() queryDto: SearchAdminQueryDto) {
|
||||||
@@ -122,6 +137,7 @@ export class UsersController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation({ summary: "create admin ==> admin route" })
|
@ApiOperation({ summary: "create admin ==> admin route" })
|
||||||
|
@AuthGuards()
|
||||||
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
||||||
@Post("admins")
|
@Post("admins")
|
||||||
createAdmin(@Body() createDto: CreateAdminDto) {
|
createAdmin(@Body() createDto: CreateAdminDto) {
|
||||||
@@ -129,6 +145,7 @@ export class UsersController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation({ summary: "get all permissions ==> admin route" })
|
@ApiOperation({ summary: "get all permissions ==> admin route" })
|
||||||
|
@AuthGuards()
|
||||||
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
||||||
@Get("permissions")
|
@Get("permissions")
|
||||||
getPermissions() {
|
getPermissions() {
|
||||||
@@ -136,6 +153,7 @@ export class UsersController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation({ summary: "get all roles ==> admin route" })
|
@ApiOperation({ summary: "get all roles ==> admin route" })
|
||||||
|
@AuthGuards()
|
||||||
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
||||||
@Get("roles")
|
@Get("roles")
|
||||||
getRoles(@Query() queryDto: SearchRolesQueryDto) {
|
getRoles(@Query() queryDto: SearchRolesQueryDto) {
|
||||||
@@ -143,12 +161,16 @@ export class UsersController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation({ summary: "create role ==> admin route" })
|
@ApiOperation({ summary: "create role ==> admin route" })
|
||||||
|
@AuthGuards()
|
||||||
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
@PermissionsDec(PermissionEnum.ADMINS, PermissionEnum.CUSTOMERS)
|
||||||
@Post("roles")
|
@Post("roles")
|
||||||
createRole(@Body() createDto: CreateRoleDto) {
|
createRole(@Body() createDto: CreateRoleDto) {
|
||||||
return this.usersService.createRole(createDto);
|
return this.usersService.createRole(createDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
@ApiOperation({ summary: "Create real user data" })
|
@ApiOperation({ summary: "Create real user data" })
|
||||||
|
@AuthGuards()
|
||||||
@HttpCode(HttpStatus.CREATED)
|
@HttpCode(HttpStatus.CREATED)
|
||||||
@Post("real-user")
|
@Post("real-user")
|
||||||
createRealUser(@Body() createDto: CreateRealUserDto, @UserDec("id") userId: string) {
|
createRealUser(@Body() createDto: CreateRealUserDto, @UserDec("id") userId: string) {
|
||||||
@@ -156,6 +178,7 @@ export class UsersController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation({ summary: "Create legal user data" })
|
@ApiOperation({ summary: "Create legal user data" })
|
||||||
|
@AuthGuards()
|
||||||
@HttpCode(HttpStatus.CREATED)
|
@HttpCode(HttpStatus.CREATED)
|
||||||
@Post("legal-user")
|
@Post("legal-user")
|
||||||
createLegalUser(@Body() createDto: CreateLegalUserDto, @UserDec("id") userId: string) {
|
createLegalUser(@Body() createDto: CreateLegalUserDto, @UserDec("id") userId: string) {
|
||||||
@@ -163,6 +186,7 @@ export class UsersController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation({ summary: "Create customer" })
|
@ApiOperation({ summary: "Create customer" })
|
||||||
|
@AuthGuards()
|
||||||
@HttpCode(HttpStatus.CREATED)
|
@HttpCode(HttpStatus.CREATED)
|
||||||
@Post("customer")
|
@Post("customer")
|
||||||
createCustomer(@Body() createDto: CreateCustomerDto) {
|
createCustomer(@Body() createDto: CreateCustomerDto) {
|
||||||
|
|||||||
Reference in New Issue
Block a user