File tree 1 file changed +4
-6
lines changed
src/useCases/authentication
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 1
1
import { IAuthentication } from "../../providers/authentication/IAuthentication" ;
2
2
import { IUseRepository } from "../../repositories/IUseRepository" ;
3
3
import { IUserAuthenticationDTO } from "./IUserAuthenticationDTO" ;
4
+ import { Response , Request } from 'express' ;
4
5
5
6
6
7
export class UserAuthentication {
8
+
7
9
constructor (
8
10
private userRepository : IUseRepository ,
9
11
private authentication : IAuthentication
10
12
) { }
11
13
12
- async execute ( data : IUserAuthenticationDTO ) {
14
+ async execute ( data : IUserAuthenticationDTO , response : Response , request : Request ) {
13
15
14
16
const verifyUser = await this . userRepository . findByEmailAndPassword ( data . email , data . password ) ;
15
17
16
18
if ( ! verifyUser ) {
17
19
throw new Error ( "User not Exist" ) ;
18
20
}
19
-
20
-
21
21
22
- // console.log("teste")
23
22
24
- // console.log(data.email,data.password)
23
+ await this . authentication . userAuthentication ( verifyUser , response , request ) ;
25
24
26
- await this . authentication . userAuthentication ( verifyUser ) ;
27
25
28
26
}
29
27
You can’t perform that action at this time.
0 commit comments