From 2ca013e46ed3b6af97f8c0b43564c5c227d956ad Mon Sep 17 00:00:00 2001 From: lmarkus Date: Mon, 30 Dec 2013 23:07:07 -0800 Subject: [PATCH] Force add two test users --- index.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/index.js b/index.js index 6a035b9..c96e5da 100644 --- a/index.js +++ b/index.js @@ -13,6 +13,26 @@ var kraken = require('kraken-js'), app.configure = function configure(nconf, next) { // Async method run on startup. db.config(nconf.get('databaseConfig')); + + //Add two users to the system. + var u1 = new User({ + name: 'Kraken McSquid', + login: 'kraken', + password: 'releaseMe', + role: 'admin' + }); + + var u2 = new User({ + name: 'Ash Williams', + login: 'awilliams', + password: 'boomstick', + role: 'user' + }); + + //Ignore errors. In this case, the errors will be for duplicate keys as we run this app more than once. + u1.save(); + u2.save(); + //Tell passport to use our newly created local strategy for authentication passport.use(auth.localStrategy());