aboutsummaryrefslogtreecommitdiff
path: root/clientapi
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-10-10 11:14:16 +0100
committerNeil Alexander <neilalexander@users.noreply.github.com>2022-10-10 11:14:16 +0100
commitfb6cb2dbcbeb7cd7546ca4d126394720d215c310 (patch)
treea40f27545a4ac651ea3bf68d846d71bb229a3541 /clientapi
parent80a0ab6246aa095f428430c38b13861406dd5c78 (diff)
Tweak `GetAccountByPassword` more
Diffstat (limited to 'clientapi')
-rw-r--r--clientapi/auth/password.go6
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{