【问题标题】:Testing Google One Tap - closed and now getting "suppressed-by-user" message测试 Google One Tap - 已关闭,现在收到“用户禁止”消息
【发布时间】:2020-11-04 06:52:58
【问题描述】:

我正在将Google One Tap api 添加到 React 应用程序。我正确地显示了一键登录模式。但是,我单击关闭模式,现在得到以下响应,我看到该响应基于此 api 的 cool down period

{
  "g": "display",
  "h": false,
  "j": "suppressed_by_user"
}

由于我正在测试应用程序,有没有办法覆盖这个冷却时间?

看起来像following

  componentDidMount() {
    const handleCredentialResponse = response => {
      console.log(response);
    };
    const client_id = "424242424-example26example44examplexyz.apps.googleusercontent.com";
    const callback = handleCredentialResponse;
    const auto_select = true;

    google.accounts.id.initialize({ client_id, callback, auto_select });

    google.accounts.id.prompt(notification => {
      console.log(notification);
    });
  }

【问题讨论】:

    标签: javascript reactjs google-api google-signin google-one-tap


    【解决方案1】:

    我想我已经解决了这个问题。我必须遵循以下指南才能完全清除 localhost:3000 的缓存:https://superuser.com/questions/278948/clear-cache-for-specific-domain-name-in-chrome

    F12 > Chrome Developer Tools > Application 选项卡 > Clear storage 在左侧树中 > 选择所有数据项 > 单击 Clear site data

    【讨论】:

      【解决方案2】:

      在开发过程中避免“冷却”的另一种方法是使用隐身浏览器模式。

      您可以重新启动隐身浏览器以清除所有缓存的内容。

      【讨论】:

      • 由于某种原因,在隐身 Chrome 中永远不会触发一键模式。是只有我还是其他人也有这个问题?在常规干净的 Chrome 会话、包括隐身和其他浏览器的 FireFox 中完美运行。看起来一键登录开始尊重隐身模式。有人可以确认吗?
      猜你喜欢
      • 2019-02-06
      • 2020-09-20
      • 2021-04-02
      • 2021-03-20
      • 1970-01-01
      • 1970-01-01
      • 2018-05-27
      • 2020-02-03
      • 2013-11-29
      相关资源
      最近更新 更多