Yuki Takei 7 лет назад
Родитель
Сommit
f27378081a
1 измененных файлов с 5 добавлено и 6 удалено
  1. 5 6
      lib/routes/login-passport.js

+ 5 - 6
lib/routes/login-passport.js

@@ -2,6 +2,7 @@ module.exports = function(crowi, app) {
   'use strict';
   'use strict';
 
 
   var debug = require('debug')('growi:routes:login-passport')
   var debug = require('debug')('growi:routes:login-passport')
+    , logger = require('@alias/logger')('growi:routes:login-passport')
     , passport = require('passport')
     , passport = require('passport')
     , config = crowi.getConfig()
     , config = crowi.getConfig()
     , Config = crowi.model('Config')
     , Config = crowi.model('Config')
@@ -18,7 +19,7 @@ module.exports = function(crowi, app) {
     // update lastLoginAt
     // update lastLoginAt
     user.updateLastLoginAt(new Date(), (err, userData) => {
     user.updateLastLoginAt(new Date(), (err, userData) => {
       if (err) {
       if (err) {
-        console.log(`updateLastLoginAt dumps error: ${err}`);
+        logger.error(`updateLastLoginAt dumps error: ${err}`);
         debug(`updateLastLoginAt dumps error: ${err}`);
         debug(`updateLastLoginAt dumps error: ${err}`);
       }
       }
     });
     });
@@ -71,8 +72,6 @@ module.exports = function(crowi, app) {
       return next();
       return next();
     }
     }
 
 
-    const loginForm = req.body.loginForm;
-
     if (!req.form.isValid) {
     if (!req.form.isValid) {
       debug('invalid form');
       debug('invalid form');
       return res.render('login', {
       return res.render('login', {
@@ -89,7 +88,7 @@ module.exports = function(crowi, app) {
       debug('info', info);
       debug('info', info);
 
 
       if (err) {  // DB Error
       if (err) {  // DB Error
-        console.log('LDAP Server Error: ', err);
+        logger.error('LDAP Server Error: ', err);
         req.flash('warningMessage', 'LDAP Server Error occured.');
         req.flash('warningMessage', 'LDAP Server Error occured.');
         return next(); // pass and the flash message is displayed when all of authentications are failed.
         return next(); // pass and the flash message is displayed when all of authentications are failed.
       }
       }
@@ -171,7 +170,7 @@ module.exports = function(crowi, app) {
       }
       }
 
 
       if (err) {  // DB Error
       if (err) {  // DB Error
-        console.log('LDAP Server Error: ', err);
+        logger.error('LDAP Server Error: ', err);
         return res.json({
         return res.json({
           status: 'warning',
           status: 'warning',
           message: 'LDAP Server Error occured.',
           message: 'LDAP Server Error occured.',
@@ -217,7 +216,7 @@ module.exports = function(crowi, app) {
       debug('info', info);
       debug('info', info);
 
 
       if (err) {  // DB Error
       if (err) {  // DB Error
-        console.log('Database Server Error: ', err);
+        logger.error('Database Server Error: ', err);
         req.flash('warningMessage', 'Database Server Error occured.');
         req.flash('warningMessage', 'Database Server Error occured.');
         return next(); // pass and the flash message is displayed when all of authentications are failed.
         return next(); // pass and the flash message is displayed when all of authentications are failed.
       }
       }