auth defined test required
This commit is contained in:
@@ -8,12 +8,15 @@ import {
|
||||
Body,
|
||||
HttpCode,
|
||||
UseGuards,
|
||||
Req,
|
||||
} from '@nestjs/common';
|
||||
import { AuthService } from './auth.service';
|
||||
import { userLoginValidator } from './login/dtoValidator';
|
||||
import { userSelectValidator } from './select/dtoValidator';
|
||||
import { userLogoutValidator } from './logout/dtoValidator';
|
||||
import { AuthControlGuard } from '../middleware/access-control.guard';
|
||||
import { userCreatePasswordValidator } from './password/create/dtoValidator';
|
||||
import { userChangePasswordValidator } from './password/change/dtoValidator';
|
||||
|
||||
@Controller('auth')
|
||||
export class AuthController {
|
||||
@@ -34,15 +37,18 @@ export class AuthController {
|
||||
|
||||
@Post('/password/create')
|
||||
@HttpCode(200)
|
||||
async createPassword() {
|
||||
return { message: 'Password created successfully' };
|
||||
async createPassword(@Body() query: userCreatePasswordValidator) {
|
||||
return await this.authService.createPassword(query);
|
||||
}
|
||||
|
||||
@Post('/password/change')
|
||||
@HttpCode(200)
|
||||
@UseGuards(AuthControlGuard)
|
||||
async changePassword() {
|
||||
return { message: 'Password changed successfully' };
|
||||
async changePassword(
|
||||
@Body() query: userChangePasswordValidator,
|
||||
@Req() req: Request,
|
||||
) {
|
||||
return await this.authService.changePassword(query, req);
|
||||
}
|
||||
|
||||
@Post('/password/reset')
|
||||
|
||||
Reference in New Issue
Block a user