Skip to content
Snippets Groups Projects
Commit 7e4b891d authored by Ronnie Friman's avatar Ronnie Friman
Browse files

documentation update

parent 4f4bc29c
No related branches found
No related tags found
3 merge requests!59Development to master,!36Development,!33Small fixes
...@@ -19,6 +19,8 @@ export class StatesGuard implements CanActivate { ...@@ -19,6 +19,8 @@ export class StatesGuard implements CanActivate {
private gameRepository: Repository<GameEntity>, 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> { async canActivate(context: ExecutionContext): Promise<boolean> {
// get game states that are allowed access, identified by @GameStates('state') decorators in controllers // get game states that are allowed access, identified by @GameStates('state') decorators in controllers
const states = this.reflector.get<string[]>('states', context.getHandler()); const states = this.reflector.get<string[]>('states', context.getHandler());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment