Created
March 27, 2025 18:45
-
-
Save Vatsalya-singhi/93e2c5b6d08b5b53295a9748c50ebecd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Controller, Get, UseGuards } from '@nestjs/common'; | |
import { AuthGuard } from './auth.guard'; | |
import { RoleGuard } from './role.guard'; | |
@Controller('admin') | |
export class AdminController { | |
@Get() | |
@UseGuards(AuthGuard, new RoleGuard('admin')) // applying mulitple guards | |
findAll() { | |
return { message: 'Admin dashboard' }; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment