magiclabs / magic-js

Magic browser/React Native JavaScript SDK is your entry-point to integrating passwordless authentication inside your application.
https://magic.link/docs/api-reference/client-side-sdks/web
Apache License 2.0
462 stars 86 forks source link

ModalNotReady error and don't know why #706

Open jalaguerom opened 8 months ago

jalaguerom commented 8 months ago

✅ Prerequisites

❓ Question

I have a NextJS (v13.5.1) application. I installed magic-sdk (v22.0.0) and the extension for oauth (v16.0.0). In a route whose pathname is /es/dummy I start oauth flow using

await magic.current.oauth.loginWithRedirect({
    provider: 'google',
    redirectURI: `${window.location.origin}/post-login`,
});

When I come into post-login route, I use await magic.oauth.getRedirectResult(); and the response for await magic.user.isLoggedIn(); is true, so it is working as expected. I manage user info and redirect to another route /es/profile/verify from /post-login if user is not verified by my backend. When I visit /es/profile/verify route, I use await magic.user.isLoggedIn(); but I receive an error identified as ModalNotReady. I read the documentation related to this error but I cannot clarify what happens. Can someone help me?

🌎 Environment

Software Version(s)
magic-sdk 22.0.0
Chrome 120.0.6099.234
npm 8.1.0
MacOS Sonoma 14.2.1
@magic-ext/oauth 16.0.0
NextJS 13.5.1
wonesy commented 2 months ago

I am also receiving this error, but I've noticed that it only occurs when the LastPass extension is present. There may be other extensions that trigger this behavior as well, though I haven't run into them. When I disable the extension, the login modal appears correctly.

Note: other password extensions, such as 1password, seem to play nicely with magic sdk

"@remix-run/node": "^2.10.2", "@remix-run/react": "^2.10.2", "@remix-run/serve": "^2.10.2", "magic-sdk": "^28.0.3",

linux/mac chrome/brave/chromium