aboutsummaryrefslogtreecommitdiff
path: root/clientapi/routing/admin.go
diff options
context:
space:
mode:
Diffstat (limited to 'clientapi/routing/admin.go')
-rw-r--r--clientapi/routing/admin.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/clientapi/routing/admin.go b/clientapi/routing/admin.go
index 9088f771..9ed1f0ca 100644
--- a/clientapi/routing/admin.go
+++ b/clientapi/routing/admin.go
@@ -102,6 +102,7 @@ func AdminResetPassword(req *http.Request, cfg *config.ClientAPI, device *userap
if err != nil {
return util.ErrorResponse(err)
}
+ serverName := cfg.Matrix.ServerName
localpart, ok := vars["localpart"]
if !ok {
return util.JSONResponse{
@@ -109,6 +110,9 @@ func AdminResetPassword(req *http.Request, cfg *config.ClientAPI, device *userap
JSON: jsonerror.MissingArgument("Expecting user localpart."),
}
}
+ if l, s, err := gomatrixserverlib.SplitID('@', localpart); err == nil {
+ localpart, serverName = l, s
+ }
request := struct {
Password string `json:"password"`
}{}
@@ -126,6 +130,7 @@ func AdminResetPassword(req *http.Request, cfg *config.ClientAPI, device *userap
}
updateReq := &userapi.PerformPasswordUpdateRequest{
Localpart: localpart,
+ ServerName: serverName,
Password: request.Password,
LogoutDevices: true,
}