diff --git a/src/shared/states.guard.ts b/src/shared/states.guard.ts index 4a4b5d423685e8ca5c2bd68cf715c50750981cd7..9e85e94e40f92ed6b016e451c592a3025a684cad 100644 --- a/src/shared/states.guard.ts +++ b/src/shared/states.guard.ts @@ -19,6 +19,8 @@ export class StatesGuard implements CanActivate { private gameRepository: Repository<GameEntity>, ) {} + // Checks the state for gameId and grants access if it matches the criteria + // allowed states are CREATED, STARTED, PAUSED, ENDED async canActivate(context: ExecutionContext): Promise<boolean> { // get game states that are allowed access, identified by @GameStates('state') decorators in controllers const states = this.reflector.get<string[]>('states', context.getHandler());