为什么我在googleapi oauth2回调中无法访问我的状态?

时间:2017-08-27 13:42:11

标签: node.js google-api

我正试图通过使用OAuth2登录谷歌时传递一些状态。我创建了我的网址:

oauth2Client.generateAuthUrl({
    access_type: "offline",
    scope: "email",
    state: {
      whatever: 'stupid'
    }
  });

当我点击我的回调代码

router.get("/callback", async (req, res) => {
  console.log(req.params)
  ...
});

我的状态没有附在网址上,我无法在参数中看到它。我能错过什么才能访问这个状态?

0 个答案:

没有答案