0

I managed to implement the relatively new One-Tap sign-up/sign-in flows, following the get started guide here. I also have other login methods working on the same project (facebook login and email/password login). When the user logs in using one of these other methods, the One-Tap hint inviting the user to login with Google stays there, in the middle of my logged-in experience, as the hint was added to the page before the user was identified. In my login flow, I don't reload the page. I just replace/show/hide stuff on it. How can I close that Google invitation when the user decides to login with another method?

Bernardo SOUSA
  • 476
  • 4
  • 15

2 Answers2

3

you can call this method, source

googleyolo.cancelLastOperation().then(() => {


// Credential selector closed.

});
Wen W
  • 2,434
  • 1
  • 10
  • 15
1

This has changed to the following -

google.accounts.id.cancel();

Sign In With Google JavaScript API reference  |  Google Developers

Josh Unger
  • 6,717
  • 6
  • 33
  • 55