-
Notifications
You must be signed in to change notification settings - Fork 40
Social logins are laggy #63
Comments
I tried several times with the magiclabs sandbox and it was workings fine. Its also working fine in our project and we haven't got any other project with same problem, so I think it could be related to your general implementation rather than a lib problem. I noticed your login dialog is a bit laggy and saw 213 warnings of your state library, so perhaps there is an infinite re-rendering loop somewhere in your code |
oh, I tried email and it worked fine, but I just tried google and its not working. going to review this 👍🏻 |
Thanks! As I told you, happy to put some dev resources from our end into it if it can help. We've been using your code for free for months, so happy to contribute a bit if it can make this fix happen sooner 😁 |
Just need some guidelines - if you wish some help. |
Made some progress yesterday, here are some insights Found out that we are not handling the oauth state correctly, tho it used to work in previous versions, we lost the flow at some point. After fixing some code, we are left with cookie error warning - Left the issue on magic discord so we can get some help about it. also, went further to get the state back after redirect from OAuth, following magic docs, fetching the data getting around 7s which is very slow, and with out it we are not getting the user state to pass back to wagmi. And last issue is with wagmi, i am still trying to figure out how we can send the user account to wagmi from our wallet constructor, Even though the user defines autoconnect to true, The connection is not happening after OAuth redirect which is leaving us with this behavior - CleanShot.2023-05-03.at.12.07.52.mp4Unless user clicks on connect again, it won't automatically connect after redirect. Resources
|
It seems like the issue is due to this isAuthorized check in wagmi's autoconnect. Updating isAuthorized for the magic auth connector like this seems to resolve the issue: async isAuthorized() {
try {
const isLoggedIn = await this.magic.user.isLoggedIn();
if (isLoggedIn) {
return true;
}
const result = await this.magic.oauth.getRedirectResult();
return result !== null;
} catch {
return false;
}
} I combined |
@ZYJLiu Thanks a lot, Tried this approach which is working ! but i am getting the same issue of wagmi not connecting automatically after the flow where i had to click on connect button manually. (same as video i posted previously) CleanShot.2023-05-03.at.12.07.52.mp4Does it happen for you ? |
Wow thats true, its connecting after some time. Weird that it takes that much time and also don't trigger loading state on Wagmi. but for now we will merge for new release, and i hope we can figure out a solution for the delay on connection issue in upcoming PRs. |
Partial fix released under |
Describe the bug
Randomly, 70-90% of the time, social login won't be working - in production at mobula.fi for instance.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Successfully connect using socials.
Additional context
Been discussing with magic.link Customer Success team, they also build an MVP to reproduce the error, I'll link it down here asap.
The text was updated successfully, but these errors were encountered: