Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

83
Views
switch login screen to home firebase and google

I have no idea how I can get through the google login from the login to home screen

I want to perform an action that when the user clicks login with google it checks if it's right and goes straight to home

<!-- language: Js -->
screen config Firebase


    import { initializeApp } from "firebase/app";
    import { getAuth, GoogleAuthProvider, signInWithPopup } from "firebase/auth";
  
    const firebaseConfig = {
      apiKey: "AIzaSyADaTNLtR-zJyY2JGbiIjxEqyIRSEvOB0g",
      authDomain: "projetotcc-d6d47.firebaseapp.com",
      databaseURL: "https://projetotcc-d6d47-default-rtdb.firebaseio.com",
      projectId: "projetotcc-d6d47",
      storageBucket: "projetotcc-d6d47.appspot.com",
      messagingSenderId: "1041839304552",
      appId: "1:1041839304552:web:e862a59abc6c747d6730dd",
      measurementId: "G-D8CEEJPRVS"
    };


    const app = initializeApp(firebaseConfig);
    export const auth = getAuth(app);

    const provider = new GoogleAuthProvider();

    export const signInWithGoogle = () => {

      signInWithPopup(auth, provider)
        .then((result) => {
          const name = result.user.displayName;
          const userid = result.user.uid;
          const email = result.user.email;
          const profilePic = result.user.photoURL;


          localStorage.setItem("name", name);
          localStorage.setItem("email", email);
          localStorage.setItem("userid", userid);
          localStorage.setItem("profilePic", profilePic);
         
        })
        .catch((error) => {
          console.log(error);
        });

        
    };
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You need to set-up a listener that will check whether a user is logged in or not, and depending on this display either the authentication screen or the home screen.

Check this doc to know how to do this and an example. Also, this doc for sing-in with Google.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!