From 2e712a35e3f65a9a5b39184fa9f3dcbc5251c10c Mon Sep 17 00:00:00 2001
From: L4168 <L4168@student.jamk.fi>
Date: Tue, 18 Jun 2019 13:14:57 +0300
Subject: [PATCH] added global guard

---
 src/app.module.ts | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/app.module.ts b/src/app.module.ts
index c86c99d..f593d72 100644
--- a/src/app.module.ts
+++ b/src/app.module.ts
@@ -1,5 +1,5 @@
 import { Module } from '@nestjs/common';
-import { APP_FILTER, APP_INTERCEPTOR } from '@nestjs/core';
+import { APP_FILTER, APP_INTERCEPTOR, APP_GUARD } from '@nestjs/core';
 import { TypeOrmModule } from '@nestjs/typeorm';
 import { AppController } from './app.controller';
 import { AppService } from './app.service';
@@ -11,6 +11,7 @@ import { LoggingInterceptor } from './shared/logging.interceptor';
 import { MapMarkerModule } from './mapmarkers/mapmarkers.module';
 import { NotificationModule } from './notifications/notifications.module';
 import { GameModule } from './game/game.module';
+import { RolesGuard } from './shared/roles.guard';
 
 @Module({
   imports: [
@@ -31,6 +32,10 @@ import { GameModule } from './game/game.module';
       provide: APP_INTERCEPTOR,
       useClass: LoggingInterceptor,
     },
+    {
+      provide: APP_GUARD,
+      useClass: RolesGuard
+    }
   ],
 })
 export class AppModule {
-- 
GitLab