From fe53feafd07593b0215c6bebaaab4ab426e8eebb Mon Sep 17 00:00:00 2001 From: devkiloton Date: Sun, 17 Apr 2022 19:42:54 -0300 Subject: [PATCH 1/6] Adding missing imports in the code --- .../database-next/read-and-write/rtdb_social_write_fan_out.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/database-next/read-and-write/rtdb_social_write_fan_out.js b/snippets/database-next/read-and-write/rtdb_social_write_fan_out.js index 783eca2b..692e4964 100644 --- a/snippets/database-next/read-and-write/rtdb_social_write_fan_out.js +++ b/snippets/database-next/read-and-write/rtdb_social_write_fan_out.js @@ -5,7 +5,7 @@ // 'npm run snippets'. // [START rtdb_social_write_fan_out_modular] -import { getDatabase, ref, child, push, update } from "firebase/database"; +import { getDatabase, ref, update, push, child } from "firebase/database"; function writeNewPost(uid, username, picture, title, body) { const db = getDatabase(); From bf266283ca8f0f6e4d98eb81409200aecacfcd63 Mon Sep 17 00:00:00 2001 From: devkiloton Date: Thu, 21 Apr 2022 08:41:02 -0300 Subject: [PATCH 2/6] Updating the source file --- .../database-next/read-and-write/rtdb_social_write_fan_out.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/database-next/read-and-write/rtdb_social_write_fan_out.js b/snippets/database-next/read-and-write/rtdb_social_write_fan_out.js index 692e4964..783eca2b 100644 --- a/snippets/database-next/read-and-write/rtdb_social_write_fan_out.js +++ b/snippets/database-next/read-and-write/rtdb_social_write_fan_out.js @@ -5,7 +5,7 @@ // 'npm run snippets'. // [START rtdb_social_write_fan_out_modular] -import { getDatabase, ref, update, push, child } from "firebase/database"; +import { getDatabase, ref, child, push, update } from "firebase/database"; function writeNewPost(uid, username, picture, title, body) { const db = getDatabase(); From da136f98042ca310f5239ec4f4a854f787e4e4b7 Mon Sep 17 00:00:00 2001 From: devkiloton Date: Thu, 21 Apr 2022 09:59:11 -0300 Subject: [PATCH 3/6] removing changes generated --- .../database-next/read-and-write/rtdb_social_write_fan_out.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/snippets/database-next/read-and-write/rtdb_social_write_fan_out.js b/snippets/database-next/read-and-write/rtdb_social_write_fan_out.js index 783eca2b..f787d4bd 100644 --- a/snippets/database-next/read-and-write/rtdb_social_write_fan_out.js +++ b/snippets/database-next/read-and-write/rtdb_social_write_fan_out.js @@ -5,8 +5,6 @@ // 'npm run snippets'. // [START rtdb_social_write_fan_out_modular] -import { getDatabase, ref, child, push, update } from "firebase/database"; - function writeNewPost(uid, username, picture, title, body) { const db = getDatabase(); From 6c0a24f606e81d5c7cd2d7f8e14e24eaf083b4e5 Mon Sep 17 00:00:00 2001 From: devkiloton Date: Thu, 21 Apr 2022 11:27:28 -0300 Subject: [PATCH 4/6] npm run snippets --- .../database-next/read-and-write/rtdb_social_write_fan_out.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/snippets/database-next/read-and-write/rtdb_social_write_fan_out.js b/snippets/database-next/read-and-write/rtdb_social_write_fan_out.js index f787d4bd..783eca2b 100644 --- a/snippets/database-next/read-and-write/rtdb_social_write_fan_out.js +++ b/snippets/database-next/read-and-write/rtdb_social_write_fan_out.js @@ -5,6 +5,8 @@ // 'npm run snippets'. // [START rtdb_social_write_fan_out_modular] +import { getDatabase, ref, child, push, update } from "firebase/database"; + function writeNewPost(uid, username, picture, title, body) { const db = getDatabase(); From 8a3cb82b71a5762eff24b026303707fdda5a4525 Mon Sep 17 00:00:00 2001 From: rosariopf Date: Fri, 22 Apr 2022 16:03:01 +0100 Subject: [PATCH 5/6] fix the error handling on auth snippets --- auth-next/apple.js | 6 +++--- auth-next/facebook.js | 8 ++++---- auth-next/github.js | 4 ++-- auth-next/google-signin.js | 8 ++++---- auth-next/index.js | 2 +- auth-next/multi-tenancy.js | 4 ++-- auth-next/oidc.js | 6 +++--- auth-next/saml.js | 4 ++-- auth-next/twitter.js | 4 ++-- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/auth-next/apple.js b/auth-next/apple.js index 29a33dea..7cffca8b 100644 --- a/auth-next/apple.js +++ b/auth-next/apple.js @@ -45,7 +45,7 @@ function appleSignInPopup(provider) { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The credential that was used. const credential = OAuthProvider.credentialFromError(error); @@ -85,7 +85,7 @@ function appleSignInRedirectResult() { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The credential that was used. const credential = OAuthProvider.credentialFromError(error); @@ -123,7 +123,7 @@ function appleReauthenticatePopup() { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The credential that was used. const credential = OAuthProvider.credentialFromError(error); diff --git a/auth-next/facebook.js b/auth-next/facebook.js index 90414d7e..67b397f2 100644 --- a/auth-next/facebook.js +++ b/auth-next/facebook.js @@ -40,7 +40,7 @@ function facebookSignInPopup(provider) { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = FacebookAuthProvider.credentialFromError(error); @@ -66,7 +66,7 @@ function facebookSignInRedirectResult() { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // AuthCredential type that was used. const credential = FacebookAuthProvider.credentialFromError(error); // ... @@ -102,7 +102,7 @@ function checkLoginState_wrapper() { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = FacebookAuthProvider.credentialFromError(error); // ... @@ -156,7 +156,7 @@ function authWithCredential(credential) { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = FacebookAuthProvider.credentialFromError(error); // ... diff --git a/auth-next/github.js b/auth-next/github.js index 941a9047..babfd1ee 100644 --- a/auth-next/github.js +++ b/auth-next/github.js @@ -46,7 +46,7 @@ function githubSignInPopup(provider) { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = GithubAuthProvider.credentialFromError(error); // ... @@ -75,7 +75,7 @@ function githubSignInRedirectResult() { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = GithubAuthProvider.credentialFromError(error); // ... diff --git a/auth-next/google-signin.js b/auth-next/google-signin.js index 1e1cee59..136c26b5 100644 --- a/auth-next/google-signin.js +++ b/auth-next/google-signin.js @@ -39,7 +39,7 @@ function googleSignInPopup(provider) { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = GoogleAuthProvider.credentialFromError(error); // ... @@ -65,7 +65,7 @@ function googleSignInRedirectResult() { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = GoogleAuthProvider.credentialFromError(error); // ... @@ -87,7 +87,7 @@ function googleBuildAndSignIn(id_token) { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = GoogleAuthProvider.credentialFromError(error); // ... @@ -123,7 +123,7 @@ function onSignIn_wrapper() { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The credential that was used. const credential = GoogleAuthProvider.credentialFromError(error); // ... diff --git a/auth-next/index.js b/auth-next/index.js index c4dadfe0..b4a17903 100644 --- a/auth-next/index.js +++ b/auth-next/index.js @@ -107,7 +107,7 @@ function authWithCredential(credential) { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // ... }); // [END auth_signin_credential] diff --git a/auth-next/multi-tenancy.js b/auth-next/multi-tenancy.js index c0c86662..d7577f34 100644 --- a/auth-next/multi-tenancy.js +++ b/auth-next/multi-tenancy.js @@ -273,7 +273,7 @@ function accountExistsPopupTenant(auth, samlProvider, googleProvider, goToApp) { const pendingCred = error.credential; // The credential's tenantId if needed: error.tenantId // The provider account's email address. - const email = error.email; + const email = error.customData.email; // Get sign-in methods for this email. fetchSignInMethodsForEmail(email, auth) .then((methods) => { @@ -315,7 +315,7 @@ function accountExistsRedirectTenant(auth, samlProvider, googleProvider, goToApp // The pending SAML credential. pendingCred = error.credential; // The provider account's email address. - const email = error.email; + const email = error.customData.email; // Need to set the tenant ID again as the page was reloaded and the // previous setting was reset. auth.tenantId = tenantId; diff --git a/auth-next/oidc.js b/auth-next/oidc.js index 5dc20e81..dae69fe9 100644 --- a/auth-next/oidc.js +++ b/auth-next/oidc.js @@ -24,7 +24,7 @@ function oidcSignInPopup(provider) { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = OAuthProvider.credentialFromError(error); // Handle / display error. @@ -58,7 +58,7 @@ function oidcSignInRedirectResult(provider) { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = OAuthProvider.credentialFromError(error); // Handle / display error. @@ -86,7 +86,7 @@ function oidcDirectSignIn(provider, oidcIdToken) { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = OAuthProvider.credentialFromError(error); // Handle / display error. diff --git a/auth-next/saml.js b/auth-next/saml.js index 9a5683d9..cdecce56 100644 --- a/auth-next/saml.js +++ b/auth-next/saml.js @@ -24,7 +24,7 @@ function samlSignInPopup(provider) { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = SAMLAuthProvider.credentialFromError(error); // Handle / display error. @@ -58,7 +58,7 @@ function samlSignInRedirectResult(provider) { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = SAMLAuthProvider.credentialFromError(error); // Handle / display error. diff --git a/auth-next/twitter.js b/auth-next/twitter.js index 57416b03..a386e4ab 100644 --- a/auth-next/twitter.js +++ b/auth-next/twitter.js @@ -36,7 +36,7 @@ function twitterSignInPopup(provider) { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = TwitterAuthProvider.credentialFromError(error); // ... @@ -65,7 +65,7 @@ function twitterSignInRedirectResult() { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = TwitterAuthProvider.credentialFromError(error); // ... From 16e641022c7165692fa207308be966bd66a15f55 Mon Sep 17 00:00:00 2001 From: rosariopf Date: Fri, 22 Apr 2022 17:10:44 +0100 Subject: [PATCH 6/6] npm run snippets --- snippets/auth-next/apple/auth_apple_reauthenticate_popup.js | 2 +- snippets/auth-next/apple/auth_apple_signin_popup.js | 2 +- snippets/auth-next/apple/auth_apple_signin_redirect_result.js | 2 +- snippets/auth-next/facebook/auth_facebook_callback.js | 2 +- snippets/auth-next/facebook/auth_facebook_signin_credential.js | 2 +- snippets/auth-next/facebook/auth_facebook_signin_popup.js | 2 +- .../auth-next/facebook/auth_facebook_signin_redirect_result.js | 2 +- snippets/auth-next/github/auth_github_signin_popup.js | 2 +- snippets/auth-next/github/auth_github_signin_redirect_result.js | 2 +- snippets/auth-next/google-signin/auth_google_build_signin.js | 2 +- snippets/auth-next/google-signin/auth_google_callback.js | 2 +- .../auth-next/google-signin/auth_google_signin_credential.js | 2 +- snippets/auth-next/google-signin/auth_google_signin_popup.js | 2 +- .../google-signin/auth_google_signin_redirect_result.js | 2 +- snippets/auth-next/index/auth_signin_credential.js | 2 +- .../auth-next/multi-tenancy/multitenant_account_exists_popup.js | 2 +- .../multi-tenancy/multitenant_account_exists_redirect.js | 2 +- snippets/auth-next/oidc/auth_oidc_direct_sign_in.js | 2 +- snippets/auth-next/oidc/auth_oidc_signin_popup.js | 2 +- snippets/auth-next/oidc/auth_oidc_signin_redirect_result.js | 2 +- snippets/auth-next/saml/auth_saml_signin_popup.js | 2 +- snippets/auth-next/saml/auth_saml_signin_redirect_result.js | 2 +- snippets/auth-next/twitter/auth_twitter_signin_popup.js | 2 +- .../auth-next/twitter/auth_twitter_signin_redirect_result.js | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/snippets/auth-next/apple/auth_apple_reauthenticate_popup.js b/snippets/auth-next/apple/auth_apple_reauthenticate_popup.js index 129fe920..cd40151d 100644 --- a/snippets/auth-next/apple/auth_apple_reauthenticate_popup.js +++ b/snippets/auth-next/apple/auth_apple_reauthenticate_popup.js @@ -32,7 +32,7 @@ reauthenticateWithPopup(auth.currentUser, provider) const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The credential that was used. const credential = OAuthProvider.credentialFromError(error); diff --git a/snippets/auth-next/apple/auth_apple_signin_popup.js b/snippets/auth-next/apple/auth_apple_signin_popup.js index 2db09607..c2a392cf 100644 --- a/snippets/auth-next/apple/auth_apple_signin_popup.js +++ b/snippets/auth-next/apple/auth_apple_signin_popup.js @@ -25,7 +25,7 @@ signInWithPopup(auth, provider) const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The credential that was used. const credential = OAuthProvider.credentialFromError(error); diff --git a/snippets/auth-next/apple/auth_apple_signin_redirect_result.js b/snippets/auth-next/apple/auth_apple_signin_redirect_result.js index 68dba4ab..654f95e5 100644 --- a/snippets/auth-next/apple/auth_apple_signin_redirect_result.js +++ b/snippets/auth-next/apple/auth_apple_signin_redirect_result.js @@ -25,7 +25,7 @@ getRedirectResult(auth) const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The credential that was used. const credential = OAuthProvider.credentialFromError(error); diff --git a/snippets/auth-next/facebook/auth_facebook_callback.js b/snippets/auth-next/facebook/auth_facebook_callback.js index 8596bb68..63106871 100644 --- a/snippets/auth-next/facebook/auth_facebook_callback.js +++ b/snippets/auth-next/facebook/auth_facebook_callback.js @@ -26,7 +26,7 @@ function checkLoginState(response) { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = FacebookAuthProvider.credentialFromError(error); // ... diff --git a/snippets/auth-next/facebook/auth_facebook_signin_credential.js b/snippets/auth-next/facebook/auth_facebook_signin_credential.js index dcd42c7e..3b784f24 100644 --- a/snippets/auth-next/facebook/auth_facebook_signin_credential.js +++ b/snippets/auth-next/facebook/auth_facebook_signin_credential.js @@ -19,7 +19,7 @@ signInWithCredential(auth, credential) const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = FacebookAuthProvider.credentialFromError(error); // ... diff --git a/snippets/auth-next/facebook/auth_facebook_signin_popup.js b/snippets/auth-next/facebook/auth_facebook_signin_popup.js index 2bc014ed..7d35aaf2 100644 --- a/snippets/auth-next/facebook/auth_facebook_signin_popup.js +++ b/snippets/auth-next/facebook/auth_facebook_signin_popup.js @@ -24,7 +24,7 @@ signInWithPopup(auth, provider) const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = FacebookAuthProvider.credentialFromError(error); diff --git a/snippets/auth-next/facebook/auth_facebook_signin_redirect_result.js b/snippets/auth-next/facebook/auth_facebook_signin_redirect_result.js index 49f3a494..eb6cdb30 100644 --- a/snippets/auth-next/facebook/auth_facebook_signin_redirect_result.js +++ b/snippets/auth-next/facebook/auth_facebook_signin_redirect_result.js @@ -20,7 +20,7 @@ getRedirectResult(auth) const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // AuthCredential type that was used. const credential = FacebookAuthProvider.credentialFromError(error); // ... diff --git a/snippets/auth-next/github/auth_github_signin_popup.js b/snippets/auth-next/github/auth_github_signin_popup.js index 74e76cc9..e1b4768e 100644 --- a/snippets/auth-next/github/auth_github_signin_popup.js +++ b/snippets/auth-next/github/auth_github_signin_popup.js @@ -22,7 +22,7 @@ signInWithPopup(auth, provider) const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = GithubAuthProvider.credentialFromError(error); // ... diff --git a/snippets/auth-next/github/auth_github_signin_redirect_result.js b/snippets/auth-next/github/auth_github_signin_redirect_result.js index 6147d9de..b3d31d0a 100644 --- a/snippets/auth-next/github/auth_github_signin_redirect_result.js +++ b/snippets/auth-next/github/auth_github_signin_redirect_result.js @@ -24,7 +24,7 @@ getRedirectResult(auth) const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = GithubAuthProvider.credentialFromError(error); // ... diff --git a/snippets/auth-next/google-signin/auth_google_build_signin.js b/snippets/auth-next/google-signin/auth_google_build_signin.js index 6df84e3e..98f35eb2 100644 --- a/snippets/auth-next/google-signin/auth_google_build_signin.js +++ b/snippets/auth-next/google-signin/auth_google_build_signin.js @@ -17,7 +17,7 @@ signInWithCredential(auth, credential).catch((error) => { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = GoogleAuthProvider.credentialFromError(error); // ... diff --git a/snippets/auth-next/google-signin/auth_google_callback.js b/snippets/auth-next/google-signin/auth_google_callback.js index 27aa8dc6..873778dd 100644 --- a/snippets/auth-next/google-signin/auth_google_callback.js +++ b/snippets/auth-next/google-signin/auth_google_callback.js @@ -25,7 +25,7 @@ function onSignIn(googleUser) { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The credential that was used. const credential = GoogleAuthProvider.credentialFromError(error); // ... diff --git a/snippets/auth-next/google-signin/auth_google_signin_credential.js b/snippets/auth-next/google-signin/auth_google_signin_credential.js index a3a8808e..25c6f3ba 100644 --- a/snippets/auth-next/google-signin/auth_google_signin_credential.js +++ b/snippets/auth-next/google-signin/auth_google_signin_credential.js @@ -10,7 +10,7 @@ signInWithCredential(auth, credential).catch((error) => { const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The credential that was used. const credential = GoogleAuthProvider.credentialFromError(error); // ... diff --git a/snippets/auth-next/google-signin/auth_google_signin_popup.js b/snippets/auth-next/google-signin/auth_google_signin_popup.js index 55c46488..d6c70eb9 100644 --- a/snippets/auth-next/google-signin/auth_google_signin_popup.js +++ b/snippets/auth-next/google-signin/auth_google_signin_popup.js @@ -21,7 +21,7 @@ signInWithPopup(auth, provider) const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = GoogleAuthProvider.credentialFromError(error); // ... diff --git a/snippets/auth-next/google-signin/auth_google_signin_redirect_result.js b/snippets/auth-next/google-signin/auth_google_signin_redirect_result.js index a64977bb..50c4aded 100644 --- a/snippets/auth-next/google-signin/auth_google_signin_redirect_result.js +++ b/snippets/auth-next/google-signin/auth_google_signin_redirect_result.js @@ -21,7 +21,7 @@ getRedirectResult(auth) const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = GoogleAuthProvider.credentialFromError(error); // ... diff --git a/snippets/auth-next/index/auth_signin_credential.js b/snippets/auth-next/index/auth_signin_credential.js index ba2db6b8..c2b027a3 100644 --- a/snippets/auth-next/index/auth_signin_credential.js +++ b/snippets/auth-next/index/auth_signin_credential.js @@ -19,7 +19,7 @@ signInWithCredential(auth, credential) const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // ... }); // [END auth_signin_credential_modular] \ No newline at end of file diff --git a/snippets/auth-next/multi-tenancy/multitenant_account_exists_popup.js b/snippets/auth-next/multi-tenancy/multitenant_account_exists_popup.js index 43734616..7bf33262 100644 --- a/snippets/auth-next/multi-tenancy/multitenant_account_exists_popup.js +++ b/snippets/auth-next/multi-tenancy/multitenant_account_exists_popup.js @@ -19,7 +19,7 @@ signInWithPopup(auth, samlProvider) const pendingCred = error.credential; // The credential's tenantId if needed: error.tenantId // The provider account's email address. - const email = error.email; + const email = error.customData.email; // Get sign-in methods for this email. fetchSignInMethodsForEmail(email, auth) .then((methods) => { diff --git a/snippets/auth-next/multi-tenancy/multitenant_account_exists_redirect.js b/snippets/auth-next/multi-tenancy/multitenant_account_exists_redirect.js index f8a3942d..a81617dd 100644 --- a/snippets/auth-next/multi-tenancy/multitenant_account_exists_redirect.js +++ b/snippets/auth-next/multi-tenancy/multitenant_account_exists_redirect.js @@ -20,7 +20,7 @@ getRedirectResult(auth).catch((error) => { // The pending SAML credential. pendingCred = error.credential; // The provider account's email address. - const email = error.email; + const email = error.customData.email; // Need to set the tenant ID again as the page was reloaded and the // previous setting was reset. auth.tenantId = tenantId; diff --git a/snippets/auth-next/oidc/auth_oidc_direct_sign_in.js b/snippets/auth-next/oidc/auth_oidc_direct_sign_in.js index 65f693a6..558fd915 100644 --- a/snippets/auth-next/oidc/auth_oidc_direct_sign_in.js +++ b/snippets/auth-next/oidc/auth_oidc_direct_sign_in.js @@ -22,7 +22,7 @@ signInWithCredential(auth, credential) const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = OAuthProvider.credentialFromError(error); // Handle / display error. diff --git a/snippets/auth-next/oidc/auth_oidc_signin_popup.js b/snippets/auth-next/oidc/auth_oidc_signin_popup.js index 76b01b1d..130d617e 100644 --- a/snippets/auth-next/oidc/auth_oidc_signin_popup.js +++ b/snippets/auth-next/oidc/auth_oidc_signin_popup.js @@ -18,7 +18,7 @@ signInWithPopup(auth, provider) const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = OAuthProvider.credentialFromError(error); // Handle / display error. diff --git a/snippets/auth-next/oidc/auth_oidc_signin_redirect_result.js b/snippets/auth-next/oidc/auth_oidc_signin_redirect_result.js index ae5a441d..bc76a620 100644 --- a/snippets/auth-next/oidc/auth_oidc_signin_redirect_result.js +++ b/snippets/auth-next/oidc/auth_oidc_signin_redirect_result.js @@ -19,7 +19,7 @@ getRedirectResult(auth) const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = OAuthProvider.credentialFromError(error); // Handle / display error. diff --git a/snippets/auth-next/saml/auth_saml_signin_popup.js b/snippets/auth-next/saml/auth_saml_signin_popup.js index 8010a17b..3a922a9a 100644 --- a/snippets/auth-next/saml/auth_saml_signin_popup.js +++ b/snippets/auth-next/saml/auth_saml_signin_popup.js @@ -18,7 +18,7 @@ signInWithPopup(auth, provider) const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = SAMLAuthProvider.credentialFromError(error); // Handle / display error. diff --git a/snippets/auth-next/saml/auth_saml_signin_redirect_result.js b/snippets/auth-next/saml/auth_saml_signin_redirect_result.js index 4e4d4260..e4bf73de 100644 --- a/snippets/auth-next/saml/auth_saml_signin_redirect_result.js +++ b/snippets/auth-next/saml/auth_saml_signin_redirect_result.js @@ -19,7 +19,7 @@ getRedirectResult(auth) const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = SAMLAuthProvider.credentialFromError(error); // Handle / display error. diff --git a/snippets/auth-next/twitter/auth_twitter_signin_popup.js b/snippets/auth-next/twitter/auth_twitter_signin_popup.js index a5fb5a95..ae8e2007 100644 --- a/snippets/auth-next/twitter/auth_twitter_signin_popup.js +++ b/snippets/auth-next/twitter/auth_twitter_signin_popup.js @@ -24,7 +24,7 @@ signInWithPopup(auth, provider) const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = TwitterAuthProvider.credentialFromError(error); // ... diff --git a/snippets/auth-next/twitter/auth_twitter_signin_redirect_result.js b/snippets/auth-next/twitter/auth_twitter_signin_redirect_result.js index 53b42c85..73e42bab 100644 --- a/snippets/auth-next/twitter/auth_twitter_signin_redirect_result.js +++ b/snippets/auth-next/twitter/auth_twitter_signin_redirect_result.js @@ -24,7 +24,7 @@ getRedirectResult(auth) const errorCode = error.code; const errorMessage = error.message; // The email of the user's account used. - const email = error.email; + const email = error.customData.email; // The AuthCredential type that was used. const credential = TwitterAuthProvider.credentialFromError(error); // ...