diff --git a/src/shared/roles.guard.ts b/src/shared/roles.guard.ts index e65916a94b3cc552259a63a9f5395e3118f95e1b..73693f9e1551da1b1b34056a665eb59c1211b3ef 100644 --- a/src/shared/roles.guard.ts +++ b/src/shared/roles.guard.ts @@ -32,9 +32,9 @@ export class RolesGuard implements CanActivate { return false; } const gameId = request.params.id; - const user = await this.getUserObject(request.headers.authorization); + request.user = await this.getUserObject(request.headers.authorization); const role = await this.game_PersonRepository.findOne({ - person: user['id'], + person: request.user['id'], game: gameId, }); // check that the role matches the criteria and that token is valid for this game