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()),
|
JSON: jsonerror.BadJSON("The request body could not be read: " + err.Error()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var userId string
|
||||||
login, errRes := userInteractiveAuth.Verify(ctx, bodyBytes, deviceAPI)
|
if deviceAPI.AccountType != api.AccountTypeAppService {
|
||||||
if errRes != nil {
|
login, errRes := userInteractiveAuth.Verify(ctx, bodyBytes, deviceAPI)
|
||||||
return *errRes
|
if errRes != nil {
|
||||||
|
return *errRes
|
||||||
|
}
|
||||||
|
userId = login.Username()
|
||||||
|
} else {
|
||||||
|
userId = deviceAPI.UserID
|
||||||
}
|
}
|
||||||
|
localpart, _, err := gomatrixserverlib.SplitID('@', userId)
|
||||||
localpart, _, err := gomatrixserverlib.SplitID('@', login.Username())
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
util.GetLogger(req.Context()).WithError(err).Error("gomatrixserverlib.SplitID failed")
|
util.GetLogger(req.Context()).WithError(err).Error("gomatrixserverlib.SplitID failed")
|
||||||
return jsonerror.InternalServerError()
|
return jsonerror.InternalServerError()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue