FIX: using header host

This commit is contained in:
Marcos Rodrigues
2025-12-03 14:41:51 -03:00
parent 7616b1e32c
commit 82290285d0
2 changed files with 8 additions and 8 deletions
+5 -5
View File
@@ -449,16 +449,16 @@ export class AuthClientService implements OnModuleInit {
return userDto;
}
private validateResourceAccess(origin: string, user: UserDTO) {
private validateResourceAccess(host: string, user: UserDTO) {
this.logger.info(
"Validate whether the source URL is a resource belonging to the user's client",
);
this.logger.info('Origin: ' + origin);
this.logger.info('Host: ' + host);
this.logger.info('Customer: ' + user.customer.name);
const urlParts = origin.replace('https://', '').split('.');
const domain = urlParts[0];
const isResouceStg = urlParts[1] === 'stg';
const hostParts = host.split('.');
const domain = hostParts[0];
const isResouceStg = hostParts[1] === 'stg';
const domainParts = domain.split('-');
const customerInDomain = domainParts[domainParts.length - 1];