Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content
This repository was archived by the owner on Jul 6, 2022. It is now read-only.

Commit b416bd1

Browse files
committed
Moving debug.
1 parent 22cde7f commit b416bd1

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

server/middleware/validate.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,27 @@ var authentication = function(req, res, next) {
7171
if (process.env.NODE_ENV === 'development') {
7272
passport.authenticate('local', { failureRedirect:'/login', failureFlash:"Invalid username or password." }) (req, res, next);
7373
} else {
74-
passport.authenticate('atlassian-crowd', { failureRedirect:'/login', failureFlash:"Invalid username or password." }) (req, res, next);
74+
// passport.authenticate('atlassian-crowd', { failureRedirect:'/login', failureFlash:"Invalid username or password." }) (req, res, next);
75+
76+
passport.authenticate('atlassian-crowd', function(err, user, info) {
77+
if (err) { return next(err) }
78+
79+
if (!user) {
80+
req.flash('error', "Invalid username or password.");
81+
return res.redirect('/login')
82+
}
83+
84+
console.log('user:')
85+
console.log(user)
86+
87+
// req.logIn(user, function(err) {
88+
// if (err) { return next(err); }
89+
// return res.redirect('/users/' + user.username);
90+
// });
91+
//
92+
}) (req, res, next);
93+
7594
}
76-
77-
console.log("response:")
78-
console.log(res)
7995

8096
};
8197
module.exports.authentication = authentication;

0 commit comments

Comments
 (0)