-
-
Save shreykoo/28286708290d6dd16f6b7e3ebeb5cb13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Magic } from 'magic-sdk'; | |
const handleSubmit = async () => { | |
const magic = new Magic('pk_live_EEAF75C2D0DAC00E'); | |
const redirectURI = `${window.location.origin}/auth/cb`; | |
await magic.auth.loginWithMagicLink({ email: value, redirectURI }); | |
const isLoggedIn = await magic.user.isLoggedIn(); | |
if(isLoggedIn){ | |
console.log(await magic.user.getMetadata()) | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment