updated events
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user