Permalink
Browse files

Adding a global user to the example.

  • Loading branch information...
1 parent c7338c7 commit 84b53ee57fe72259864697a8bb87b80276c55e80 @travist committed Feb 19, 2013
Showing with 12 additions and 2 deletions.
  1. +12 −2 example/app.js
View
@@ -4,9 +4,19 @@ var LocalStrategy = require('passport-local').Strategy
var fipassport = require('flatiron-passport');
var app = flatiron.app;
+// You would not usually have these lines...
+// This is just to store the username in memory.
+var global_user = '';
+var global_pass = '';
+
// Use the passport strategy.
fipassport.use(new LocalStrategy(function(username, password, done) {
+ // You would not normally have these lines...
+ // This is just to store it in memory for use later.
+ global_user = username;
+ global_pass = password;
+
// Use this as you normally would in Passport.js.
// But for now just
// hard-code the user object.
@@ -31,8 +41,8 @@ fipassport.deserializeUser(function(id, done) {
// that user object.
done(null, {
id:id,
- username:'foo',
- password:'bar'
+ username:global_user,
+ password:global_pass
});
});

0 comments on commit 84b53ee

Please sign in to comment.