Closed dottodot closed 8 years ago
I had the same issue. I fixed it by editing the endpoint method in api/services/passport.js
, specifically setting options to be the provider options, rather than always set to { }
endpoint: function (req, res) {
var strategies = sails.config.passport;
var provider = req.param('provider');
// var options = { };
var options = strategies[provider].options || {};
if (!strategies.hasOwnProperty(provider)) {
return res.redirect('/login');
}
if (strategies[provider].hasOwnProperty('scope')) {
options.scope = strategies[provider].scope;
}
this.authenticate(provider, options)(req, res, req.next);
}
Works great thanks for your help.
When using passport-google-oauth there are extra params that you can use for example hostedDomain so you can restrict access to a particular google app domain as described here.
However I can't work out how to include this param, I have tried the following but I doesn't work.
I've also tried it outside of options and that doesn't work either.