feature: detection of incomplete register
parent
ee65139bfc
commit
fb49b165c6
|
|
@ -35,6 +35,12 @@ func Login(c *fiber.Ctx) error {
|
||||||
"token": ""})
|
"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 {
|
if err := bcrypt.CompareHashAndPassword(user.Password, []byte(data["password"])); err != nil {
|
||||||
return c.JSON(fiber.Map{
|
return c.JSON(fiber.Map{
|
||||||
"message": "Senha inválida",
|
"message": "Senha inválida",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue