Skip to content

RolesGuard is fully implemented but never wired into the app #19

Description

@presidojay1

src/auth/guards/roles.guard.ts implements role-based authorization (and has a passing unit test), but RolesGuard is never registered as a global guard nor applied anywhere, so it's dead code that looks like an active security control.

Suggested fix: Register it globally in AppModule: add { provide: APP_GUARD, useClass: RolesGuard } to providers (importing APP_GUARD from @nestjs/core), matching the existing pattern of registering JwtAuthGuard the same way. Only wire this in if the guard already defaults to allow-when-no-@roles()-metadata (verify before applying) so no existing route's behavior changes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions