This repository was archived by the owner on Aug 1, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ JWT_SECRET ='p4sta.w1th-b0logn3s3-s@uce'
4
4
5
5
# Mongo DB
6
6
# Local development
7
- MONGODB_URI = ' localhost:12345'
7
+ MONGODB_URI = ' mongodb:// localhost:12345/ceos '
8
8
9
9
# Port
10
10
PORT = 3000
Original file line number Diff line number Diff line change 1
- import { IUser } from '../interfaces/IUser' ;
2
1
import mongoose from 'mongoose' ;
2
+ import { ICandidate } from '../interfaces' ;
3
3
4
4
const Candidate = new mongoose . Schema (
5
5
{
@@ -17,4 +17,4 @@ const Candidate = new mongoose.Schema(
17
17
{ timestamps : true } ,
18
18
) ;
19
19
20
- export default mongoose . model < IUser & mongoose . Document > ( 'Candidate' , Candidate ) ;
20
+ export default mongoose . model < ICandidate & mongoose . Document > ( 'Candidate' , Candidate ) ;
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ export default class AuthService {
75
75
public async SignIn ( email : string , password : string ) : Promise < { user : IUser ; token : string } > {
76
76
const userRecord = await this . userModel . findOne ( { email } ) ;
77
77
if ( ! userRecord ) {
78
- throw createError ( 400 , 'User not registered' ) ;
78
+ throw createError ( 404 , 'User not registered' ) ;
79
79
}
80
80
/**
81
81
* We use verify from argon2 to prevent 'timing based' attacks
@@ -95,7 +95,7 @@ export default class AuthService {
95
95
*/
96
96
return { user, token } ;
97
97
} else {
98
- throw createError ( 400 , 'Invalid Password' ) ;
98
+ throw createError ( 422 , 'Invalid Password' ) ;
99
99
}
100
100
}
101
101
You can’t perform that action at this time.
0 commit comments