forked from jason/cpolis
Show error messages in UI if something goes wrong
This commit is contained in:
@@ -99,8 +99,8 @@ func Login(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFunc {
|
||||
userName := r.PostFormValue("username")
|
||||
password := r.PostFormValue("password")
|
||||
|
||||
id, ok := db.GetID(userName)
|
||||
if !ok {
|
||||
id := db.GetID(userName)
|
||||
if id == 0 {
|
||||
http.Error(w, fmt.Sprintf("no such user: %v", userName), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user