Skip to content

Commit

Permalink
reword port and oauth flow
Browse files Browse the repository at this point in the history
  • Loading branch information
samccone committed Apr 3, 2013
1 parent 2153de0 commit a173969
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ffframe",
"version": "0.0.0-1",
"version": "0.0.0-2",
"description": "social pj",
"main": "server.js",
"scripts": {
Expand Down
4 changes: 1 addition & 3 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
global.port = process.env['port'] || 3000;
var port = process.env['port'] || 3000;
var colors = require('colors');
var express = require('express');
var expressValidator = require('express-validator');
Expand All @@ -8,7 +8,6 @@ var db = require('./util/db/interface').connect();
var passport = require('passport');
var passportConfig = require('./util/auth/config')(passport);


server.configure(function() {
server.use(express.cookieParser());
server.use(express.bodyParser());
Expand All @@ -22,7 +21,6 @@ server.configure(function() {
server.use(express.static(__dirname + "/public"));
});


router(server, passport);

server.listen(port);
Expand Down
7 changes: 4 additions & 3 deletions util/auth/config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
var port = process.env['port'] || 3000;
var GoogleStrategy = require('passport-google').Strategy;
var controllers = require('../../controllers/controllers')
var root = process.env['NODE_ENV'] ? "http://ffframe.jit.su" : "http://localhost:"+port

module.exports = function(passport) {
passport.use(new GoogleStrategy({
returnURL: "http://localhost:"+global.port+"/auth/google/return",
realm: "http://localhost:"+global.port+"/"
returnURL: root+"/auth/google/return",
realm: root+"/"
}, function(id, p, done) {
return done(null, p);
}
));


passport.serializeUser(function(user, done) {
done(null, user);
});
Expand Down

0 comments on commit a173969

Please sign in to comment.