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 { Router } from 'express';
import * as SessionController from '../controllers/session.controller'; import * as SessionController from '../controllers/session.controller';
<<<<<<< HEAD
import passport from 'passport'; import passport from 'passport';
=======
>>>>>>> add framework for sessions
const router = new Router(); const router = new Router();
router.route('/login').get(SessionController.newSession); router.route('/login').get(SessionController.newSession);
<<<<<<< HEAD
router.route('/login').post(SessionController.createSession); router.route('/login').post(SessionController.createSession);
router.route('/logout').get(SessionController.destroySession); router.route('/logout').get(SessionController.destroySession);
//TODO add github authentication stuff //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
//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(Express.static(path.resolve(__dirname, '../static')));
app.use(bodyParser.urlencoded({extended: true})); app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json()); app.use(bodyParser.json());