updated events

This commit is contained in:
2025-08-02 20:08:43 +03:00
parent b54bbe2db2
commit 1b87dee60d
9 changed files with 202 additions and 56 deletions

View File

@@ -8,7 +8,7 @@ import { RedisHandlers } from '@/src/utils/auth/redis_handlers';
@Injectable()
export class AuthControlGuard implements CanActivate {
constructor(private cacheService: RedisHandlers) {}
constructor(private cacheService: RedisHandlers) { }
async canActivate(context: ExecutionContext): Promise<boolean> {
const req = context.switchToHttp().getRequest();
@@ -20,15 +20,18 @@ export class AuthControlGuard implements CanActivate {
@Injectable()
export class EndpointControlGuard implements CanActivate {
constructor(private cacheService: RedisHandlers) {}
constructor(private cacheService: RedisHandlers) { }
async canActivate(context: ExecutionContext): Promise<boolean> {
const req = context.switchToHttp().getRequest();
// const selectToken = this.cacheService.mergeSelectKey(req);
// const method = req.method;
// const path = req.route?.path;
const accessObject = await this.cacheService.getSelectFromRedis(req);
console.log('EndpointControlGuard', accessObject);
const method = req.method;
const path = req.route?.path;
console.log('EndpointControlGuard', method, 'path', path);
// const accessObject = await this.cacheService.getSelectFromRedis(req);
// console.log('EndpointControlGuard', accessObject);
req.driveToken = "c5b6d9c7-9115-4825-bcc1-16f409a7004a"
// console.log('EndpointControlGuard', req.driveToken);
return true;
}
}