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