tenant auto assign fix

This commit is contained in:
Efstratios Giannopoulos 2024-07-04 18:16:00 +03:00
parent 72230b6b0a
commit 04e857542c
1 changed files with 2 additions and 1 deletions

View File

@ -124,7 +124,8 @@ public class TenantInterceptor implements WebRequestInterceptor {
if (cacheValue != null) {
isUserAllowedTenant = cacheValue.isAllowed();
} else {
isUserAllowedTenant = this.isUserAllowedTenant();
List<String> tenants = this.claimExtractor.asStrings(this.currentPrincipalResolver.currentPrincipal(), ClaimNames.TenantCodesClaimName);
if (tenants.contains(this.tenantScope.getTenantCode())) isUserAllowedTenant = this.isUserAllowedTenant();
this.userAllowedTenantCacheService.put(new UserAllowedTenantCacheService.UserAllowedTenantCacheValue(this.userScope.getUserId(), this.tenantScope.getTenant(), isUserAllowedTenant));
}
}