Skip to content

Commit

Permalink
feat: protect routes with guard
Browse files Browse the repository at this point in the history
  • Loading branch information
iaurg committed Oct 29, 2023
1 parent 5b851f6 commit bd73436
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion backend/src/leaderboard/leaderboard.controller.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Controller, Get, Param } from '@nestjs/common';
import { Controller, Get, Param, UseGuards } from '@nestjs/common';
import { LeaderboardService } from './leaderboard.service';
import { AccessTokenGuard } from 'src/auth/jwt/jwt.guard';

@Controller('leaderboard')
@UseGuards(AccessTokenGuard)
export class LeaderboardController {
constructor(private readonly leaderboardService: LeaderboardService) {}

Expand Down
5 changes: 3 additions & 2 deletions backend/src/match-history/match-history.controller.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Controller, Get, Post, Body, Param } from '@nestjs/common';
import { Controller, Get, Post, Body, Param, UseGuards } from '@nestjs/common';
import { MatchHistoryService } from './match-history.service';
import { CreateMatchHistoryDto } from './dto/create-match-history.dto';
import { AccessTokenGuard } from 'src/auth/jwt/jwt.guard';

//TODO: add auth guard
@Controller('match-history')
@UseGuards(AccessTokenGuard)
export class MatchHistoryController {
constructor(private readonly matchHistoryService: MatchHistoryService) {}

Expand Down

0 comments on commit bd73436

Please sign in to comment.