magic-js icon indicating copy to clipboard operation
magic-js copied to clipboard

OAuth loginWithRedirect method resolves before redirect

Open mightymatth opened this issue 3 years ago • 0 comments

✅ Prerequisites

  • [x] Did you perform a cursory search of open issues? Is this bug already reported elsewhere?
  • [x] Are you running the latest SDK version?
  • [x] Are you reporting to the correct repository (magic-sdk)?

🐛 Description

A promise returned from oauth.loginWithRedirect() method is returned too early before the redirect actually happens.

🧩 Steps to Reproduce

  1. Have one of OAuth providers enabled
  2. execute oauth.loginWithRedirect() and wait for result

🤔 Expected behavior

The promise from oauth.loginWithRedirect() should resolve just as redirect happens (or after, but not far before the redirect happens).

😮 Actual behavior

The promise resolves in about 100ms, but the redirect happens for, at least, 1 second after the promise resolves. It breaks the UI if we rely on this promise and we need to do hacks to lengthen it to last until the redirect.

mightymatth avatar Feb 28 '22 10:02 mightymatth