I have the following code:
app.js:
var passport = require('passport') , FacebookStrategy = require('passport-facebook').Strategy , ... passport.serializeUser(function(user, done) { console.log('serializing user') done(null, user); }) passport.deserializeUser(function(obj, done) { console.log('deserializeUser') done(null, obj) }) passport.use(new FacebookStrategy({ clientID: FBAPP.id, clientSecret: FBAPP.secret, callbackURL: "http://www.mylocal.com:3000/auth/facebook/callback" }, function(accessToken, refreshToken, profile, done) {
The angular part:
factory('FacebookFactory', ['$http', '$q', function($http, $q) { var get = function() { var deferred = $q.defer(); $http({method: 'GET', url: '/auth/facebook'}). success(function(data, status, headers, config) { deferred.resolve(data); }). error(function(data, status, headers, config) { deferred.reject(data); }); return deferred.promise; }; return { get: get }; }])
I always get this error and make several attempts, but have not succeeded.
XMLHttpRequest cannot load https:
Any idea? I tried it only in angular, but then it does not work in Safari, but in Chrome and FF it works fine.
www.mylocal.com//000 = localhost: 3000