Skip to content

Commit 2e96471

Browse files
committed
removed console logs from server files
1 parent 091b6b9 commit 2e96471

File tree

3 files changed

+0
-13
lines changed

3 files changed

+0
-13
lines changed

server/controllers/cookieController.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const cookieController = {};
22

33
// setSSIDCookie - store the user id from database in cookie
44
cookieController.setSSIDCookie = (req, res, next) => {
5-
console.log('inside setSSIDCookie');
65
// set cookie with key 'ssid' and value to user's id
76
res.cookie('ssid', res.locals.id, {
87
httpOnly: true,

server/controllers/sessionController.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ sessionController.isLoggedIn = (req, res, next) => {
3333

3434
// startSession - create and save a new session into the database
3535
sessionController.startSession = (req, res, next) => {
36-
console.log('inside startSession');
3736
// first check if user is logged in already
3837
Sessions.findOne({ cookieId: res.locals.id }, (err, ses) => {
3938
if (err) {
@@ -70,7 +69,6 @@ sessionController.startSession = (req, res, next) => {
7069
};
7170

7271
sessionController.gitHubResponse = (req, res, next) => {
73-
console.log('inside gitHubResponse');
7472
const { code } = req.query;
7573
if (!code) {
7674
console.log('code not found');
@@ -97,7 +95,6 @@ sessionController.gitHubResponse = (req, res, next) => {
9795
)
9896
.then(res => res.json())
9997
.then(token => {
100-
console.log('token:', token);
10198
res.locals.token = token['access_token'];
10299
return next();
103100
})
@@ -107,7 +104,6 @@ sessionController.gitHubResponse = (req, res, next) => {
107104
};
108105

109106
sessionController.gitHubSendToken = (req, res, next) => {
110-
console.log('inside gitHubSendToken');
111107
const { token } = res.locals;
112108
fetch(`https://api.github.com/user/public_emails`, {
113109
method: 'GET',
@@ -143,7 +139,6 @@ sessionController.gitHubSendToken = (req, res, next) => {
143139

144140
// creates a session when logging in with github
145141
sessionController.githubSession = (req, res, next) => {
146-
console.log('inside gitHubSession');
147142
// req.user is passed in from passport js -> serializeuser/deserializeuser
148143
const cookieId = req.user._id;
149144
Sessions.findOne({ cookieId }, (err, session) => {

server/controllers/userController.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ const randomPassword = () => {
2626
};
2727

2828
userController.createUser = (req, res, next) => {
29-
console.log('inside createUser');
3029
let email, username, password;
3130
// use this condition for Oauth login
3231
if (res.locals.signUpType === 'oauth') {
33-
console.log('line 33 of create user')
3432
email = res.locals.githubEmail;
3533
username = email;
3634
password = randomPassword();
@@ -54,14 +52,12 @@ userController.createUser = (req, res, next) => {
5452
// handle error of creating a new user
5553
if (err) {
5654
if (res.locals.signUpType === 'oauth') {
57-
console.log('line 56 of userController'); // oauth enters this condition
5855
return next();
5956
}
6057
if (err.keyValue.email) {
6158
return res.status(400).json('Email Taken');
6259
}
6360
if (err.keyValue.username && res.locals.signUpType === 'oauth') {
64-
console.log('line 56 of userController');
6561
res.locals.githubPassword = password;
6662
return next();
6763
}
@@ -78,17 +74,14 @@ userController.createUser = (req, res, next) => {
7874
}
7975
// if no error found when creating a new user, send back user ID in res.locals
8076
res.locals.id = newUser.id;
81-
console.log('line 78 of userController');
8277
return next();
8378
});
8479
};
8580

8681
// verifyUser - Obtain username and password from the request body, locate
8782
// the appropriate user in the database, and then authenticate the submitted password against the password stored in the database.
8883
userController.verifyUser = (req, res, next) => {
89-
console.log('inside verifyUser');
9084
let { username, password, isFbOauth } = req.body;
91-
console.log(username, password, isFbOauth);
9285
// handle Oauth
9386
if (res.locals.signUpType === 'oauth') {
9487
username = res.locals.githubEmail;

0 commit comments

Comments
 (0)