From a22ab3eee6f2d6e41f0345e930c61c86e2e61ad7 Mon Sep 17 00:00:00 2001 From: kegsay Date: Mon, 2 Aug 2021 13:11:23 +0100 Subject: [PATCH] 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. --- clientapi/routing/deactivate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()