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

111
Views
my homepage wont render using my google oauth

This is the error that I get: "You have created a new client application that use…i/web/guides/gis-migration) for more information."

here are my codes on server, the statement inside console.log doesnt even show:


static async googleLogin(req, res, next) {
  try {
    console.log("masuk google login server")
    const { id_token } = req.body
    const client = new OAuth2Client(process.env.GOOGLE_CLIENT_ID)
    const ticket = await client.verifyIdToken({
        idToken: id_token,
        audience: process.env.GOOGLE_CLIENT_ID
    });

    const payload = ticket.getPayload()
    const email = payload.email
    let password = email.toString().split('@')
    password = password[0]
    let user = await User.findOne({ where: { email } })
    if (!user) {
        let newUser = { email, password }
        let createUser = await User.create(newUser)
        const payload = {
            id: createUser.id,
            email: createUser.email
        }
        const access_token = generateToken(payload)
        return res.status(201).json({ access_token })
    } else {
        const payload = {
            id: user.id,
            email: user.email
        }
        const access_token = generateToken(payload)
        return res.status(200).json({ access_token })
    }

  } catch (err) {
      console.log(err)
      return next(err)
  }
}

the console.log in my client also doesnt show


function onSignIn(googleUser) {
    console.log("masuk client oauth")
    $.ajax({
        method: "POST",
        url: `${baseUrl}/users/google-login`,
        data: {
            id_token: googleUser.getAuthResponse().id_token
        }
    })
        .done((response) => {
            console.log(response, "client response")
            localStorage.setItem("access_token", response.access_token)
            checkLocalStorage();
        })
        .fail((err) => {
            console.log(err, "error client");
        })
        .always(() => {
            authentication()
        })
}

i tried deleting cache and run my app again, recreate a new project on google api (which genereated new ID). they didnt work

about 4 years ago · Juan Pablo Isaza
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!