From 504aa917868a1c7677bdf82603443351e0d7e317 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 2 Aug 2021 12:39:37 +0100 Subject: [PATCH] Read the right username field when performing account deactivation `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 effe3769d..9e3b0bfb3 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()