diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-06-06 17:29:50 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-06-06 17:29:50 -0400 |
| commit | fdac6c79935fa9b773cbb9d4a0c2499726764777 (patch) | |
| tree | 8457a6d7abf1b5dedcadb1a7021aac9b2d6e7446 /server/index.js | |
| parent | 8f12d34393708ab2ec03a5ad44bc83bc86f16dc9 (diff) | |
creating new users with email and password
Diffstat (limited to 'server/index.js')
| -rw-r--r-- | server/index.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/index.js b/server/index.js index 59dc7a5..a45ff36 100644 --- a/server/index.js +++ b/server/index.js @@ -41,6 +41,7 @@ app.use(express.session({ })); app.use(express.bodyParser()); app.use(express.query()); +app.use(express.csrf()); app.use(express.methodOverride()); app.use(passport.initialize()); app.use(passport.session()); @@ -55,10 +56,13 @@ auth.init() // Essential middleware // app.all('*', middleware.enableCORS); +app.all('*', middleware.ensureLocals); + // Initialize views app.get('/', views.home); app.get('/login', views.login); -app.post('/login', auth.loggedIn('local')); +app.post('/auth/signin', auth.loggedIn('local')); +app.post('/auth/signup', auth.signup); app.get('/logout', auth.logout); app.get('/auth/twitter', auth.login('twitter')); app.get('/auth/twitter/callback', auth.loggedIn('twitter')); |
