mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-26 00:03:09 -06:00
Do not check if a username is exclusive if the request is for an appservice in /register
This commit is contained in:
parent
9a1ef81fa2
commit
b3ba38bd87
|
|
@ -488,10 +488,16 @@ func Register(
|
||||||
return *resErr
|
return *resErr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Extract access token here
|
||||||
|
accessToken, _ := auth.ExtractAccessToken(req)
|
||||||
|
|
||||||
// Make sure normal user isn't registering under an exclusive application
|
// Make sure normal user isn't registering under an exclusive application
|
||||||
// service namespace. Skip this check if no app services are registered.
|
// service namespace. Skip this check if no app services are registered.
|
||||||
|
// If an access token is provided, ignore this check this is an appservice
|
||||||
|
// request and we will validate in validateApplicationService
|
||||||
if r.Auth.Type != authtypes.LoginTypeApplicationService &&
|
if r.Auth.Type != authtypes.LoginTypeApplicationService &&
|
||||||
len(cfg.Derived.ApplicationServices) != 0 &&
|
len(cfg.Derived.ApplicationServices) != 0 &&
|
||||||
|
accessToken == "" &&
|
||||||
UsernameMatchesExclusiveNamespaces(cfg, r.Username) {
|
UsernameMatchesExclusiveNamespaces(cfg, r.Username) {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue