Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.

Commit f55ebd7

Browse files
committed
[Chore] update .env
1 parent 38aa7fd commit f55ebd7

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ JWT_SECRET ='p4sta.w1th-b0logn3s3-s@uce'
44

55
# Mongo DB
66
# Local development
7-
MONGODB_URI='localhost:12345'
7+
MONGODB_URI='mongodb://localhost:12345/ceos'
88

99
# Port
1010
PORT=3000

src/models/candidate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { IUser } from '../interfaces/IUser';
21
import mongoose from 'mongoose';
2+
import { ICandidate } from '../interfaces';
33

44
const Candidate = new mongoose.Schema(
55
{
@@ -17,4 +17,4 @@ const Candidate = new mongoose.Schema(
1717
{ timestamps: true },
1818
);
1919

20-
export default mongoose.model<IUser & mongoose.Document>('Candidate', Candidate);
20+
export default mongoose.model<ICandidate & mongoose.Document>('Candidate', Candidate);

src/services/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export default class AuthService {
7575
public async SignIn(email: string, password: string): Promise<{ user: IUser; token: string }> {
7676
const userRecord = await this.userModel.findOne({ email });
7777
if (!userRecord) {
78-
throw createError(400, 'User not registered');
78+
throw createError(404, 'User not registered');
7979
}
8080
/**
8181
* We use verify from argon2 to prevent 'timing based' attacks
@@ -95,7 +95,7 @@ export default class AuthService {
9595
*/
9696
return { user, token };
9797
} else {
98-
throw createError(400, 'Invalid Password');
98+
throw createError(422, 'Invalid Password');
9999
}
100100
}
101101

0 commit comments

Comments
 (0)