Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'triggerLogin' function remains locked after auth window closure #297

Closed
madcent opened this issue Jul 18, 2023 · 1 comment
Closed

'triggerLogin' function remains locked after auth window closure #297

madcent opened this issue Jul 18, 2023 · 1 comment

Comments

@madcent
Copy link

madcent commented Jul 18, 2023

Description

We are currently utilizing the CustomAuth to manage user sign-up and sign-in processes, as well as enabling them to sign transactions using the private key associated with their generated addresses. The module has generally functioned well, but we've recently encountered a specific issue with the Google authentication flow.

The problem arises with the 'triggerLogin' function. We've observed that if a user closes the auth window, the 'triggerLogin' function unexpectedly remains in a locked state. I've taken the initiative to investigate this issue further and have prepared a patch
that seems to resolve the problem. It will be great if a maintainer could review this proposed fix and consider integrating it into an upcoming release. Please feel free to provide any feedback or suggest modifications if required.

Steps to reproduce:

  1. create a new google verifier https://dashboard.web3auth.io/home/team/[YOUR-COMPANY]/customauth ;
  2. init the CustomAuth like:
const torus = new CustomAuth({
    baseUrl: `${window.location.origin}/serviceworker`,
    enableLogging: false,
    network: 'mainnet',
    web3AuthClientId: 'test',
  });
await torus.init({ skipSw: false });
try {
  await torus.triggerLogin({
      typeOfLogin: 'google',
      verifier: '<YOUR VERIFIER IDENTIFIER>',
      clientId: '<YOUR CLIENT ID>',
    });
} finally {
  console.log('triggerLogin has been resolved');
}
  1. google auth window will be opened;
  2. close the window;

Expected Behaviour

  1. torus.triggerLogin function is "released" and 'triggerLogin has been resolved' message appears in the console;

Actual Behaviour

  1. torus.triggerLogin function is "locked" and no 'triggerLogin has been resolved' message appears.
@chaitanyapotti
Copy link
Member

This is fixed in latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants