Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ServerApp = (function () {
- function ServerApp() {
- this._App = express();
- this._App.use(require('express-session')({secret: 'keyboard cat', resave: true, saveUninitialized: true}));
- }
- ServerApp.prototype.setRoutes = function () {
- this._App.use(express.static('client'));
- //this._App.get('/', this._RenderIndex);
- this._App.get("/cb",
- passport.authenticate('github', {failureRedirect: '/login'}),
- function (req, res) {
- // Successful authentication, redirect home.
- res.redirect('/');
- }
- );
- this._App.get("/loginScreen",function(req,res){
- res.redirect("/#/loginScreen");
- });
- this._App.get("/login",
- passport.authenticate('github', {failureRedirect: '/loginScreen'}));
- this._App.get("/",
- require('connect-ensure-login').ensureLoggedIn('/loginScreen'));
- this._App.get("*",
- require('connect-ensure-login').ensureLoggedIn('/loginScreen'));
- };
Advertisement
Add Comment
Please, Sign In to add comment