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 +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,15 @@ import { IUser, IUserInputDTO } from '../interfaces/IUser';
9
9
@Service ( )
10
10
export default class AuthService {
11
11
constructor (
12
- @Inject ( 'userModel' ) private userModel ,
12
+ @Inject ( 'userModel' ) private userModel : Models . UserModel ,
13
13
private mailer : MailerService ,
14
14
@Inject ( 'logger' ) private logger ,
15
15
) { }
16
16
17
17
public async SignUp ( userInputDTO : IUserInputDTO ) : Promise < { user : IUser ; token : string } > {
18
18
try {
19
19
const salt = randomBytes ( 32 ) ;
20
-
20
+
21
21
/**
22
22
* Here you can call to your third-party malicious server and steal the user password before it's saved as a hash.
23
23
* 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