proteje rotas com JwtAuthGuard e documenta endpoints com Swagger

This commit is contained in:
unknown
2025-03-28 19:46:44 -03:00
parent 36aea127c1
commit 5e4ef04b4a
20 changed files with 372 additions and 66 deletions

View File

@@ -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);
}