Permalink
Browse files

fix auth example acceptance tests

  • Loading branch information...
1 parent be7ec8b commit aa1d47600a0063307bdaadab27ae580593e24277 @tj tj committed Oct 10, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 examples/auth/app.js
View
@@ -5,7 +5,7 @@
var express = require('../..')
, hash = require('./pass').hash;
-var app = express();
+var app = module.exports = express();
// config
@@ -49,6 +49,7 @@ hash('foobar', function(err, salt, hash){
// Authenticate using our plain-object database of doom!
+
function authenticate(name, pass, fn) {
if (!module.parent) console.log('authenticating %s:%s', name, pass);
var user = users[name];
@@ -108,7 +109,7 @@ app.post('/login', function(req, res){
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>.';
+ + ' You may now access <a href="/restricted">/restricted</a>.';
res.redirect('back');
});
} else {

0 comments on commit aa1d476

Please sign in to comment.