Permalink
Browse files

Merge branch 'master' of github.com:visionmedia/express

  • Loading branch information...
2 parents 76d3ec5 + 077d8b9 commit eeef763f6d3bb2d61b4b9add65ff9fba2275cc41 @tj tj committed Oct 6, 2012
Showing with 3 additions and 6 deletions.
  1. +3 −6 examples/auth/app.js
View
@@ -1,4 +1,3 @@
-
/**
* Module dependencies.
*/
@@ -91,11 +90,6 @@ app.get('/logout', function(req, res){
});
app.get('/login', function(req, res){
- if (req.session.user) {
- req.session.success = 'Authenticated as ' + req.session.user.name
- + ' click to <a href="/logout">logout</a>. '
- + ' You may now access <a href="/restricted">/restricted</a>.';
- }
res.render('login');
});
@@ -109,6 +103,9 @@ app.post('/login', function(req, res){
// in the session store to be retrieved,
// or in this case the entire user object
req.session.user = user;
+ req.session.success = 'Authenticated as ' + user.name
+ + ' click to <a href="/logout">logout</a>. '
+ + ' You may now access <a href="/restricted">/restricted</a>.';
res.redirect('back');
});
} else {

0 comments on commit eeef763

Please sign in to comment.