javascript - Testing Google One Tap - closed and now getting "suppressed-by-user" message - Stack Overflow

I am adding the Google One Tap api to a React application. I am correctly getting the one tap login mod

I am adding the Google One Tap api to a React application. I am correctly getting the one tap login modal showing up. However, I clicked to close the modal, and now am getting the following response, which I see is based on the cool down period for this api:

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

Since I am testing the application, is there a way to override this cool down period?

Looks like the following:

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

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

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

I am adding the Google One Tap api to a React application. I am correctly getting the one tap login modal showing up. However, I clicked to close the modal, and now am getting the following response, which I see is based on the cool down period for this api:

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

Since I am testing the application, is there a way to override this cool down period?

Looks like the following:

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

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

    google.accounts.id.prompt(notification => {
      console.log(notification);
    });
  }
Share Improve this question edited Jul 15, 2020 at 10:21 Vadim Kotov 8,2848 gold badges50 silver badges63 bronze badges asked Jul 14, 2020 at 20:35 maudulusmaudulus 11.1k11 gold badges85 silver badges121 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 4

When trying to migrate to the FedCM API for Google One tap the accepted answer did not work for me.

The docs mention that:

When FedCM is enabled, Chrome users can reset cooldown status by clicking on the lock icon in the address bar and clicking the Reset Permission button.

Just click on the icon next to URL in the address bar, and select Site Settings

And then select Reset Permissions and Reload.

I think I've solved the issue. I had to follow the following guide in order to fully clear out the cache for the localhost:3000: https://superuser./questions/278948/clear-cache-for-specific-domain-name-in-chrome

F12 > Chrome Developer Tools > Application tab > Clear storage in left tree > Select all data items > click Clear site data

Another way to avoid 'cool down' during developement is to use incognito browser mode.

You can restart the incognito browser to clear all cached content.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745242264a4618252.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信