Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

165
Visualizações
Best way to manage google sign-in and regular user sign-in on my website

I have a website where the user can create an account, given the basic user information like "username", "password", "e-mail", etc...

Now, I want to implement google sign-in, but im not sure how the back-end will be managed. Should I create a different table for google users, or merge it to the original user table, but the problem is the google sign-in has no password associated with it, do I make the password not required, generate a random password, or make the user create a password?

And what if the user wants to register through the regular means with the same e-mail, but it already used the google sign-in, should the account be merged with the original one so he doesn't loose his data?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

what you are describing here is a problem that many websites have. I don't think that there is a right or a wrong answer.

From my experience: I would suggest to maintain a column in your user table that indicates the auth type. it could be "password" for users who login with password, and "google" for login with google users.

the password column should only be populated when the user actually uses the password auth mechanism. That is for security purposes to ensure no account take overs happen on accounts that are authenticated via other means.

If you want to allow users to "login with password", then you can implement a flow, that will:

  • send a confirmation email to the user (so you know the person logged in has access to that mail account)
  • when the user clicks the link asks the user to specify a password
  • then save the password and update the authentication type.

Also - the other way around - when you have a user who has a password and then starts to click "login with google" - you should probably also have a flow to migrate the user to login with google.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda