diff options
Diffstat (limited to 'clientapi/auth/password.go')
-rw-r--r-- | clientapi/auth/password.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clientapi/auth/password.go b/clientapi/auth/password.go index bcb4ca97..890b1818 100644 --- a/clientapi/auth/password.go +++ b/clientapi/auth/password.go @@ -68,6 +68,12 @@ func (t *LoginTypePassword) Login(ctx context.Context, req interface{}) (*Login, JSON: jsonerror.BadJSON("A username must be supplied."), } } + if len(r.Password) == 0 { + return nil, &util.JSONResponse{ + Code: http.StatusUnauthorized, + JSON: jsonerror.BadJSON("A password must be supplied."), + } + } localpart, err := userutil.ParseUsernameParam(username, &t.Config.Matrix.ServerName) if err != nil { return nil, &util.JSONResponse{ |