Created
April 7, 2020 21:56
-
-
Save JudahGabriel/6f2f8ddf3047f642de55d4cae7901bc1 to your computer and use it in GitHub Desktop.
pwa-auth: Listening for signin-completed event
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 pwaAuth = document.querySelector("pwa-auth"); | |
pwaAuth.addEventListener("signin-completed", ev => { | |
const signIn = ev.detail; | |
if (signIn.error) { | |
console.error("Sign in failed", signIn.error); | |
} else { | |
console.log("Email: ", signIn.email); | |
console.log("Name: ", signIn.name); | |
console.log("Picture: ", signIn.imageUrl); | |
console.log("Provider (MS, Google, FB): ", signIn.provider); | |
console.log("Raw data from provider: ", signIn.providerData); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment