Skip to content

Why do I get a Magic Extension Error (oauth): [Cannot read property 'openAuth' of null] An error has occurred #823

Description

@AB7zz

✅ Prerequisites

  • [✅ ] Did you perform a cursory search of open issues? Is this question already asked elsewhere?
  • [✅] Are you reporting to the correct repository (magic-sdk)?

❓ Question

I've initialized a magic instance as in the docs

const magic = new Magic(MAGIC_PUBLISHABLE_KEY, {
        network: {
            rpcUrl: RPC_URL_DEV,
            chainId: CHAIN_ID
        },
        extensions: [
            new OAuthExtension()
        ]
    });
const handleSocialMediaLogin = async (provider, redirectUri) => {

        try {
            setLoading(true);
            setError(null);
              const result = await magic.oauth.loginWithPopup({
                provider,
                redirectUri
              });
              console.log('OAuth login result:', result);

            setLoading(false);
        } catch (error) {
            setLoading(false);
            console.error('OAuth login error:', error);
            setError(`Error logging in with ${provider}: ${error.message}`);
        }
    }

and when I try to login using any social media, I get a OAuth login error saying "Magic Extension Error (oauth): [Cannot read property 'openAuth' of null] An error has occurred". Not sure why when I've followed everything as in the docs. I even have a dedicated wallet. Sign in with email works perfectly fine.

🌎 Environment

Software Version(s)
magic-sdk 13.6.2
Mobile iPhone
npm 10.9.0
Operating System iOS

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions