|
|
@ -13,14 +13,17 @@ export class GlobalGuard extends AuthGuard(['jwt']) { |
|
|
|
|
|
|
|
|
|
|
|
async canActivate(context: ExecutionContext) { |
|
|
|
async canActivate(context: ExecutionContext) { |
|
|
|
let result; |
|
|
|
let result; |
|
|
|
try { |
|
|
|
|
|
|
|
result = await this.extractBoolVal(super.canActivate(context)); |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
console.log(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const req = context.switchToHttp().getRequest(); |
|
|
|
const req = context.switchToHttp().getRequest(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!req.headers?.['xc-auth']) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
result = await this.extractBoolVal(super.canActivate(context)); |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
console.log(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (result && !req.headers['xc-shared-base-id']) { |
|
|
|
if (result && !req.headers['xc-shared-base-id']) { |
|
|
|
if ( |
|
|
|
if ( |
|
|
|
req.path.indexOf('/user/me') === -1 && |
|
|
|
req.path.indexOf('/user/me') === -1 && |
|
|
|