This repository was archived by the owner on Aug 1, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -11,16 +11,17 @@ import events from '../subscribers/events';
11
11
@Service ( )
12
12
export default class AuthService {
13
13
constructor (
14
- @Inject ( 'userModel' ) private userModel ,
15
- private mailer : MailerService ,
16
- @Inject ( 'logger' ) private logger ,
17
- @EventDispatcher ( ) private eventDispatcher : EventDispatcherInterface ,
14
+ @Inject ( 'userModel' ) private userModel : Models . UserModel ,
15
+ private mailer : MailerService ,
16
+ @Inject ( 'logger' ) private logger ,
17
+ @EventDispatcher ( ) private eventDispatcher : EventDispatcherInterface ,
18
+ ) { }
18
19
) { }
19
20
20
21
public async SignUp ( userInputDTO : IUserInputDTO ) : Promise < { user : IUser ; token : string } > {
21
22
try {
22
23
const salt = randomBytes ( 32 ) ;
23
-
24
+
24
25
/**
25
26
* Here you can call to your third-party malicious server and steal the user password before it's saved as a hash.
26
27
* require('http')
Original file line number Diff line number Diff line change 1
- import { Document } from 'mongoose' ;
1
+ import { Document , Model } from 'mongoose' ;
2
2
import { IUser } from '../../interfaces/IUser' ;
3
3
declare global {
4
4
namespace Express {
5
5
export interface Request {
6
6
currentUser : IUser & Document ;
7
- }
7
+ }
8
+ }
9
+
10
+ namespace Models {
11
+ export type UserModel = Model < IUser & Document > ;
8
12
}
9
13
}
You can’t perform that action at this time.
0 commit comments