added pages tested via backend
This commit is contained in:
@@ -14,6 +14,8 @@ export class AuthControlGuard implements CanActivate {
|
||||
async canActivate(context: ExecutionContext): Promise<boolean> {
|
||||
const req = context.switchToHttp().getRequest();
|
||||
const accessToken = this.cacheService.mergeLoginKey(req);
|
||||
if (!accessToken) { throw new ForbiddenException('Send to Login') }
|
||||
this.cacheService.renewTtlLoginFromRedis(req);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -32,7 +34,9 @@ export class EndpointControlGuard implements CanActivate {
|
||||
const keyUrl = `${path}:${method.toUpperCase()}`;
|
||||
const driveToken = await this.urlHandler.getSecureUrlToken(keyUrl);
|
||||
const accessObject = await this.cacheService.getSelectFromRedis(req);
|
||||
if (!accessObject) { throw new ForbiddenException('Access denied') }
|
||||
req.driveToken = `${driveToken}:${accessObject?.value.functionsRetriever}`;
|
||||
this.cacheService.renewTtlSelectFromRedis(req);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user