diff options
Diffstat (limited to 'userapi')
-rw-r--r-- | userapi/internal/api.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/userapi/internal/api.go b/userapi/internal/api.go index c1b9bcab..cf588a40 100644 --- a/userapi/internal/api.go +++ b/userapi/internal/api.go @@ -390,8 +390,9 @@ func (a *UserInternalAPI) queryAppServiceToken(ctx context.Context, token, appSe if localpart != "" { // AS is masquerading as another user // Verify that the user is registered account, err := a.AccountDB.GetAccountByLocalpart(ctx, localpart) - // Verify that account exists & appServiceID matches - if err == nil && account.AppServiceID == appService.ID { + // Verify that the account exists and either appServiceID matches or + // it belongs to the appservice user namespaces + if err == nil && (account.AppServiceID == appService.ID || appService.IsInterestedInUserID(appServiceUserID)) { // Set the userID of dummy device dev.UserID = appServiceUserID return &dev, nil |