Skip to content

Commit cddfdf2

Browse files
committed
add response and request parameters in execute fuction call
1 parent e2cb416 commit cddfdf2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/useCases/authentication/UserAuthentication.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
11
import { IAuthentication } from "../../providers/authentication/IAuthentication";
22
import { IUseRepository } from "../../repositories/IUseRepository";
33
import { IUserAuthenticationDTO } from "./IUserAuthenticationDTO";
4+
import {Response,Request} from 'express';
45

56

67
export class UserAuthentication{
8+
79
constructor(
810
private userRepository: IUseRepository,
911
private authentication: IAuthentication
1012
){}
1113

12-
async execute(data: IUserAuthenticationDTO){
14+
async execute(data: IUserAuthenticationDTO, response:Response,request:Request){
1315

1416
const verifyUser = await this.userRepository.findByEmailAndPassword(data.email,data.password);
1517

1618
if(!verifyUser){
1719
throw new Error("User not Exist");
1820
}
19-
20-
2121

22-
// console.log("teste")
2322

24-
// console.log(data.email,data.password)
23+
await this.authentication.userAuthentication(verifyUser,response,request);
2524

26-
await this.authentication.userAuthentication(verifyUser);
2725

2826
}
2927

0 commit comments

Comments
 (0)