Skip to content

Commit f79ce75

Browse files
committed
Removed console logs
1 parent ef42eff commit f79ce75

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

src/auth/googleStrategy.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
const config = require('../configs');
22
const GoogleStrategy = require('passport-google-oauth20').Strategy;
33
const { AppError } = require('../libraries/error-handling/AppError');
4-
const { getByGoogleId, create, updateById } = require('../domains/user/service');
4+
const {
5+
getByGoogleId,
6+
create,
7+
updateById,
8+
} = require('../domains/user/service');
59

610
const getGoogleStrategy = () => {
7-
console.log('config', config);
811
return new GoogleStrategy(
912
{
1013
clientID: config.GOOGLE_CLIENT_ID,
1114
clientSecret: config.GOOGLE_CLIENT_SECRET,
1215
callbackURL: `${config.HOST}/api/auth/google/callback`,
13-
scope: ['profile', 'email']
16+
scope: ['profile', 'email'],
1417
},
1518
async (accessToken, refreshToken, profile, cb) => {
1619
try {
17-
const trimmedPayloadForSession = await getOrCreateUserFromGoogleProfile({
18-
profile,
19-
accessToken,
20-
});
20+
const trimmedPayloadForSession = await getOrCreateUserFromGoogleProfile(
21+
{
22+
profile,
23+
accessToken,
24+
}
25+
);
2126
cb(null, trimmedPayloadForSession);
2227
} catch (error) {
2328
cb(error, null);
@@ -28,12 +33,12 @@ const getGoogleStrategy = () => {
2833

2934
async function getOrCreateUserFromGoogleProfile({ profile, accessToken }) {
3035
const isAdmin = config.ADMIN_USERNAMES.includes(profile.emails[0].value);
31-
36+
3237
const payload = {
3338
email: profile.emails[0].value,
3439
displayName: profile.displayName,
3540
authType: 'google',
36-
41+
3742
google: {
3843
id: profile.id,
3944
email: profile.emails[0].value,

src/domains/user/schema.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,6 @@ schema.pre('save', function (next) {
150150
);
151151
});
152152

153-
// Debug logging
154-
console.log('Auth check:', {
155-
authType: this.authType,
156-
populatedMethods,
157-
githubData: this.github,
158-
localData: this.local,
159-
googleData: this.google,
160-
});
161-
162153
// Validation
163154
if (!this.authType || !authMethods.includes(this.authType)) {
164155
return next(new Error('Invalid auth type'));

src/server.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ const createExpressApp = () => {
3838
})
3939
);
4040

41-
console.log('config', config);
4241
passport.use(localStrategy);
4342
passport.use(getGitHubStrategy());
4443
passport.use(getGoogleStrategy());

0 commit comments

Comments
 (0)