mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-15 20:39:08 +00:00
FIX: using header host
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user