This is an automated email from the ASF dual-hosted git repository.

rawlin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit f780aff77a52d52a37b4d1cc3e8e801c0b557356
Author: Rawlin Peters <[email protected]>
AuthorDate: Fri Aug 30 14:40:48 2019 -0600

    Improve ldap error handling
---
 traffic_ops/traffic_ops_golang/login/login.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/traffic_ops/traffic_ops_golang/login/login.go 
b/traffic_ops/traffic_ops_golang/login/login.go
index 07575f7..b873ef1 100644
--- a/traffic_ops/traffic_ops_golang/login/login.go
+++ b/traffic_ops/traffic_ops_golang/login/login.go
@@ -51,6 +51,10 @@ func LoginHandler(db *sqlx.DB, cfg config.Config) 
http.HandlerFunc {
                        handleErrs(http.StatusBadRequest, err)
                        return
                }
+               if form.Username == "" || form.Password == "" {
+                       api.HandleErr(w, r, nil, http.StatusBadRequest, 
errors.New("username and password are required"), nil)
+                       return
+               }
                resp := struct {
                        tc.Alerts
                }{}

Reply via email to