小编use*_*301的帖子

如何在Node.js中进行64位整数运算?

任何人有任何关于如何在Node.js中对64位整数执行算术的建议?node-int64包似乎不支持它.

javascript node.js

19
推荐指数
2
解决办法
1万
查看次数

Passport-Google-OAuth回调无法正常工作

我使用passport-google-oauth有以下节点代码...

app.get('/auth/google', passport.authenticate('google', { scope : ['profile', 'email'] }));

app.get('/auth/google/callback', function(req,res) {
    console.log("callback");
    passport.authenticate('google', {
                successRedirect : '/signin',
                failureRedirect : '/signin'
    });
});
Run Code Online (Sandbox Code Playgroud)

和...

passport.serializeUser(function(user, done) {
    console.log("ser");
    done(null, user.id);
});

passport.deserializeUser(function(id, done) {
    console.log("des");
    User.findById(id, function(err, user) {
        done(err, user);
    });
});

passport.use(new GoogleStrategy({

    clientID        : 'id',
    clientSecret    : 'key',
    callbackURL     : 'http://host/auth/google/callback',
},
function(token, rtoken, profile, done) {
   console.log("proc");
   console.log(profile);
   done(null, profile);
}));
Run Code Online (Sandbox Code Playgroud)

问题是,回调被调用但没有其他事情发生.处理功能永远不会发生.回调最终超时.我出错的任何想法?

javascript node.js passport.js

12
推荐指数
1
解决办法
1282
查看次数

如何禁用Webkit通知?

有没有办法让用户可以选择禁用webkitNotifications?如果我requestPermission()第二次拨打电话,则不会提示用户.

html5 webkit html5-notifications

5
推荐指数
1
解决办法
669
查看次数