mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-07 06:53:09 -06:00
Allow AS to deactivate it's own users (#30)
This commit is contained in:
parent
d15a4e4a61
commit
0782819d26
|
|
@ -27,13 +27,17 @@ func Deactivate(
|
|||
JSON: jsonerror.BadJSON("The request body could not be read: " + err.Error()),
|
||||
}
|
||||
}
|
||||
|
||||
var userId string
|
||||
if deviceAPI.AccountType != api.AccountTypeAppService {
|
||||
login, errRes := userInteractiveAuth.Verify(ctx, bodyBytes, deviceAPI)
|
||||
if errRes != nil {
|
||||
return *errRes
|
||||
}
|
||||
|
||||
localpart, _, err := gomatrixserverlib.SplitID('@', login.Username())
|
||||
userId = login.Username()
|
||||
} else {
|
||||
userId = deviceAPI.UserID
|
||||
}
|
||||
localpart, _, err := gomatrixserverlib.SplitID('@', userId)
|
||||
if err != nil {
|
||||
util.GetLogger(req.Context()).WithError(err).Error("gomatrixserverlib.SplitID failed")
|
||||
return jsonerror.InternalServerError()
|
||||
|
|
|
|||
Loading…
Reference in a new issue