1- import { Controller , Post , Body , Res , UseGuards , Logger } from '@nestjs/common' ;
1+ import { Controller , Post , Body , Res , Logger } from '@nestjs/common' ;
22import { PasswdService } from './passwd.service' ;
33import { ApiTags , ApiOperation , ApiResponse } from '@nestjs/swagger' ;
44import { Response } from 'express' ;
55import { ChangePasswordDto } from './dto/change-password.dto' ;
6- import { AuthGuard } from '@nestjs/passport' ;
76import { AskTokenDto } from './dto/ask-token.dto' ;
87import { VerifyTokenDto } from './dto/verify-token.dto' ;
98import { ResetPasswordDto } from './dto/reset-password.dto' ;
@@ -20,7 +19,6 @@ export class PasswdController {
2019 @ApiResponse ( { status : 200 , description : 'Password has been successfully changed.' } )
2120 @ApiResponse ( { status : 403 , description : 'Old password wrong' } )
2221 @ApiResponse ( { status : 500 , description : 'Backend error' } )
23- @UseGuards ( AuthGuard ( 'api-key' ) )
2422 public async change ( @Body ( ) cpwd : ChangePasswordDto , @Res ( ) res : Response ) : Promise < Response > {
2523 // eslint-disable-next-line @typescript-eslint/no-unused-vars
2624 const [ _ , data ] = await this . passwdService . change ( cpwd ) ;
@@ -42,7 +40,6 @@ export class PasswdController {
4240 @ApiOperation ( { summary : 'ask token for reseting password' } )
4341 @ApiResponse ( { status : 200 , description : 'Token' , content : { } } )
4442 @ApiResponse ( { status : 500 , description : 'Backend error' } )
45- @UseGuards ( AuthGuard ( 'api-key' ) )
4643 public async gettoken ( @Body ( ) asktoken : AskTokenDto , @Res ( ) res : Response ) : Promise < Response > {
4744 this . logger . log ( 'GetToken for : ' + asktoken . id ) ;
4845 const data = await this . passwdService . askToken ( asktoken ) ;
@@ -53,7 +50,6 @@ export class PasswdController {
5350 @ApiOperation ( { summary : 'ask token for reseting password' } )
5451 @ApiResponse ( { status : 201 , description : 'Token OK' } )
5552 @ApiResponse ( { status : 500 , description : 'Token KO' } )
56- @UseGuards ( AuthGuard ( 'api-key' ) )
5753 public async verifyToken ( @Body ( ) token : VerifyTokenDto , @Res ( ) res : Response ) : Promise < Response > {
5854 this . logger . log ( 'Verify token : ' + token . token ) ;
5955 if ( await this . passwdService . verifyToken ( token . token ) ) {
@@ -66,7 +62,6 @@ export class PasswdController {
6662 @ApiOperation ( { summary : 'reset password' } )
6763 @ApiResponse ( { status : 200 , description : 'Reset OK' } )
6864 @ApiResponse ( { status : 500 , description : 'Reset KO' } )
69- @UseGuards ( AuthGuard ( 'api-key' ) )
7065 public async reset ( @Body ( ) data : ResetPasswordDto , @Res ( ) res : Response ) : Promise < Response > {
7166 // eslint-disable-next-line @typescript-eslint/no-unused-vars
7267 const [ _ , resetData ] = await this . passwdService . reset ( data ) ;
0 commit comments