FedCM get() rejects with AbortError: The request has been aborted

1.2k Views Asked by At

I'm trying to implement the new FedCM api using Google sign-in. I'm currently developing my website locally and facing an issue: to improve UX, a cooldown is set in place to prevent the site from showing the "login with google" dialog too often.

I'm ok with that except that during development, I want to log in and log out a lot of times to test callbacks, features, etc.

I tried deleting the cookies, but after a short time, when calling google.accounts.id.prompt(), I'm hit with FedCM get() rejects with AbortError: The request has been aborted.

My init code is:

window.onload = function () {
    google.accounts.id.initialize({
        client_id: 'myclientid.apps.googleusercontent.com',
        use_fedcm_for_prompt: true,
        callback: authenticationCallbackHandler
    });
    //google.accounts.id.prompt();
};

Writing google.accounts.id.prompt(); directly in the browser console works.

Is there any way around this?

1

There are 1 best solutions below

0
hermz On

I am assuming you are referring to the cool-down period when user clicks the Close X in the top-right corner of the prompt. For FedCM, different browser may have different settings on cool-down period or way to reset it. But for Chrome, you can reset the cooldown status by clocking the lock icon in the address bar and clicking Reset Permission button.

enter image description here