signin.go: change login failed msg
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
leo 2023-06-04 11:57:47 +02:00
parent 3c240d3588
commit 3cacea8c1f
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ

View File

@ -80,6 +80,8 @@ func SigninPost(client *ent.Client) echo.HandlerFunc {
)
}
loginFailed := "Login Failed!"
ctx := context.WithValue(context.Background(), moduser.CtxKey{}, slogger)
if usr, err := moduser.QueryUser(ctx, client, username); err == nil {
log.Info("attempting login", "user", &usr.ID)
@ -87,7 +89,7 @@ func SigninPost(client *ent.Client) echo.HandlerFunc {
if !passwd.Compare(usr.Password, password) {
log.Warn("wrong credentials", "user", &usr.ID)
data["flash"] = "wrong credentials"
data["flash"] = loginFailed
data["form"] = cu
p.Data = data
@ -110,7 +112,7 @@ func SigninPost(client *ent.Client) echo.HandlerFunc {
}
data["form"] = cu
data["flash"] = "wrong credentials"
data["flash"] = loginFailed
p.Data = data
return c.Render(