magic-js
magic-js copied to clipboard
OAuth loginWithRedirect method resolves before redirect
✅ 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
- Have one of OAuth providers enabled
- 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.