我使用passport-facebook-token从Feathers收回JWT并在服务器端进行身份验证。在本地工作,但我在生产服务器上收到此错误:
'Strategy facebook-token is not permitted'
护照代码:
const FacebookTokenStrategy = require('passport-facebook-token');
app.passport.use('facebook-token',
new FacebookTokenStrategy(
{
clientID: process.env.FACEBOOK_CLIENT_ID,
clientSecret: process.env.FACEBOOK_CLIENT_SECRET
},
function(accessToken, refreshToken, profile, done) {
app
.service('users')
.find({
query: {
facebookId: profile.id
}
})
.then(userData => {
if (userData.data.length > 0) {
delete userData.data.password;
return done(null, userData.data[0]);
} else {
app
.service('users')
.create({})
.then(data => {
return done(null, data);
});
}
});
}
)
);