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

125
Views
Limitar solo correos electrónicos específicos para iniciar sesión con Gmail Oauth

Me preguntaba si podría simplemente hacer lo siguiente para limitar los inicios de sesión, pero parece que me encuentro con un problema en el que la página se vuelve a cargar constantemente una vez que inicio sesión una vez.

 function onSignIn(googleUser) { var profile = googleUser.getBasicProfile(); console.log('Name: ' + profile.getName()); console.log('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present. //list the emails that can login to the website using Gmail OAuth if (profile.getEmail() == "XXXXXXXX@gmail.com") { window.location.href = "./index.html" } else { let done = confirm("You don't have permission to access this.") if (done) { window.location.href = "https://www.HOMEPAGEco.uk/" } else { alert("Please try again.") } } }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

La línea window.location.href = "./index.html" siempre recargará la página; si no desea que se tomen medidas cuando están en la lista blanca, simplemente verifique si NO están en la lista.

 if (profile.getEmail() !== "XXXXXXXX@gmail.com") { let done = confirm("You don't have permission to access this.") if (done) { window.location.href = "https://www.HOMEPAGEco.uk/" } else { alert("Please try again.") } }
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!