diff --git a/mesop/examples/web_component/firebase_auth/firebase_auth_app.py b/mesop/examples/web_component/firebase_auth/firebase_auth_app.py index 1c5d54b9d..21233f410 100644 --- a/mesop/examples/web_component/firebase_auth/firebase_auth_app.py +++ b/mesop/examples/web_component/firebase_auth/firebase_auth_app.py @@ -43,13 +43,13 @@ class State: def on_auth_changed(e: mel.WebEvent): - print("AUTH", e.value) firebaseAuthToken = e.value if not firebaseAuthToken: me.state(State).email = "" return decoded_token = auth.verify_id_token(firebaseAuthToken) - if decoded_token["email"] != "allowlisted.user@gmail.com": - raise me.MesopUserException("Invalid user: " + decoded_token["email"]) + # You can do an allowlist if needed. + # if decoded_token["email"] != "allowlisted.user@gmail.com": + # raise me.MesopUserException("Invalid user: " + decoded_token["email"]) me.state(State).email = decoded_token["email"] diff --git a/mesop/examples/web_component/firebase_auth/firebase_auth_component.js b/mesop/examples/web_component/firebase_auth/firebase_auth_component.js index ddb3616db..696e0b96d 100644 --- a/mesop/examples/web_component/firebase_auth/firebase_auth_component.js +++ b/mesop/examples/web_component/firebase_auth/firebase_auth_component.js @@ -23,6 +23,7 @@ firebase.initializeApp(firebaseConfig); const uiConfig = { // TODO: change this to your Mesop page path. signInSuccessUrl: '/web_component/firebase_auth/firebase_auth_app', + signInFlow: 'popup', signInOptions: [firebase.auth.GoogleAuthProvider.PROVIDER_ID], // tosUrl and privacyPolicyUrl accept either url string or a callback // function.