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.
This commit is contained in:
Kegan Dougal 2021-08-02 12:39:37 +01:00
parent ed4097825b
commit 504aa91786

View file

@ -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()