feature: detection of incomplete register
parent
ee65139bfc
commit
fb49b165c6
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in New Issue