proteje rotas com JwtAuthGuard e documenta endpoints com Swagger
This commit is contained in:
@@ -2,6 +2,8 @@ import { Injectable } from '@nestjs/common';
|
||||
import { AuthenticateUserService } from '../auth/authenticate-user.service';
|
||||
import { ResetPasswordService } from './reset-password.service';
|
||||
import { ChangePasswordService } from './change-password.service';
|
||||
import { AuthenticateUserCommand } from '../auth/authenticate-user.command';
|
||||
|
||||
|
||||
|
||||
@Injectable()
|
||||
@@ -13,9 +15,9 @@ export class UsersService {
|
||||
) {}
|
||||
|
||||
async authenticate(user: { userName: string; password: string }) {
|
||||
return this.authenticateUserService.execute(user.userName, user.password);
|
||||
const command = new AuthenticateUserCommand(user.userName, user.password);
|
||||
return this.authenticateUserService.execute(command);
|
||||
}
|
||||
|
||||
async resetPassword(user: { document: string; email: string }) {
|
||||
return this.resetPasswordService.execute(user.document, user.email);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user