summaryrefslogtreecommitdiff
path: root/server/index.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-06-06 17:29:50 -0400
committerJules Laplace <jules@okfoc.us>2014-06-06 17:29:50 -0400
commitfdac6c79935fa9b773cbb9d4a0c2499726764777 (patch)
tree8457a6d7abf1b5dedcadb1a7021aac9b2d6e7446 /server/index.js
parent8f12d34393708ab2ec03a5ad44bc83bc86f16dc9 (diff)
creating new users with email and password
Diffstat (limited to 'server/index.js')
-rw-r--r--server/index.js6
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'));