feature: detection of incomplete register

main
Nilo Roberto C Paim 2023-11-09 10:44:13 -03:00
parent ee65139bfc
commit fb49b165c6
1 changed files with 6 additions and 0 deletions

View File

@ -35,6 +35,12 @@ func Login(c *fiber.Ctx) error {
"token": ""})
}
if user.Password == nil {
return c.JSON(fiber.Map{
"message": "Usuário com cadastro imcompleto",
"token": ""})
}
if err := bcrypt.CompareHashAndPassword(user.Password, []byte(data["password"])); err != nil {
return c.JSON(fiber.Map{
"message": "Senha inválida",