add framework for sessions

This commit is contained in:
catarak 2016-05-13 16:49:56 -04:00
parent 2b99122f30
commit 33fcafb483
2 changed files with 7 additions and 6 deletions

View File

@ -1,13 +1,20 @@
import { Router } from 'express';
import * as SessionController from '../controllers/session.controller';
<<<<<<< HEAD
import passport from 'passport';
=======
>>>>>>> add framework for sessions
const router = new Router();
router.route('/login').get(SessionController.newSession);
<<<<<<< HEAD
router.route('/login').post(SessionController.createSession);
router.route('/logout').get(SessionController.destroySession);
//TODO add github authentication stuff
=======
router.route('/logout').get(SessionController.destroySession);
>>>>>>> add framework for sessions

View File

@ -26,12 +26,6 @@ import users from './routes/user.routes';
//Body parser, cookie parser, sessions, serve public assets
//Body parser, cookie parser, sessions, serve public assets
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());
app.use(cookieParser());
app.use(session({secret: 'steve brule'}));
app.use(passport.initialize());
app.use(passport.session());
app.use(Express.static(path.resolve(__dirname, '../static')));
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());