Skip to content

Commit bbc0bbb

Browse files
rm debug console logs
1 parent 99bf658 commit bbc0bbb

File tree

3 files changed

+0
-7
lines changed

3 files changed

+0
-7
lines changed

api/controller/users.ts

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export async function login(request: IRequest, response: Response, next: Functio
2929
response.cookie('token', token, { expires: new Date(tokenObj.exp), domain} );
3030
return response.status(204).json({});
3131
} catch (err) {
32-
console.log(err); // debug
3332
if (process.env.NODE_ENV === 'production') {
3433
bugsnagClient.notify(err);
3534
}

api/models/entity/User.ts

-3
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ export class User {
126126
}
127127

128128
validatePassword(password: string) {
129-
console.log({ password });
130129
if (!password) {
131130
throw new Error('must set a password');
132131
}
@@ -136,13 +135,11 @@ export class User {
136135
iterations = 872791;
137136
}
138137
const validHash = crypto.pbkdf2Sync(password, this.salt, iterations, 32, 'sha512').toString('hex');
139-
console.log({ validHash });
140138
// prevent timing attacks
141139
let mismatch = 0;
142140
for (let i = 0; i < validHash.length; ++i) {
143141
mismatch |= (validHash.charCodeAt(i) ^ this.passwordHash.charCodeAt(i));
144142
}
145-
console.log('this far?', mismatch === 0, mismatch, 0);
146143
return mismatch === 0;
147144
}
148145

api/services/userService.ts

-3
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,7 @@ export async function createUserSessionFromLoginAsync(email, password: string):
108108
const repository = getConnection('default').getRepository('User');
109109
try {
110110
const user = await repository.findOneOrFail({email: email.toLowerCase()}) as User;
111-
console.log(user);
112111
if (user.validatePassword(password)) {
113-
console.log('valid pw');
114112
const token = await generateJWTokenAsync(user.id);
115113
await createActivityRecordAsync({
116114
currentUser: user,
@@ -123,7 +121,6 @@ export async function createUserSessionFromLoginAsync(email, password: string):
123121
throw new Error('Invalid email or password');
124122
}
125123
} catch (e) {
126-
console.log('email error', e);
127124
throw new Error('Invalid email or password');
128125
}
129126
}

0 commit comments

Comments
 (0)