aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkegsay <kegan@matrix.org>2021-08-02 13:11:23 +0100
committerGitHub <noreply@github.com>2021-08-02 13:11:23 +0100
commita22ab3eee6f2d6e41f0345e930c61c86e2e61ad7 (patch)
tree5be70a0e0bdad12531952558ed3254cbd1b6417d
parented4097825bc65f2332bcdc975ed201841221ff7c (diff)
Read the right username field when performing account deactivation (#1954)
`Login` has 2 username fields, and we were always checking the deprecated one. Instead, check both.
-rw-r--r--clientapi/routing/deactivate.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/clientapi/routing/deactivate.go b/clientapi/routing/deactivate.go
index effe3769..9e3b0bfb 100644
--- a/clientapi/routing/deactivate.go
+++ b/clientapi/routing/deactivate.go
@@ -33,7 +33,7 @@ func Deactivate(
return *errRes
}
- localpart, _, err := gomatrixserverlib.SplitID('@', login.User)
+ localpart, _, err := gomatrixserverlib.SplitID('@', login.Username())
if err != nil {
util.GetLogger(req.Context()).WithError(err).Error("gomatrixserverlib.SplitID failed")
return jsonerror.InternalServerError()