magic-js
magic-js copied to clipboard
ModalNotReady error and don't know why
✅ Prerequisites
- [x] Did you perform a cursory search of open issues? Is this question already asked elsewhere?
- [x] Are you reporting to the correct repository (
magic-sdk)?
❓ 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 |
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