Skip to content

Commit 17d1fa6

Browse files
Abdoulaye Traoreanonrig
Abdoulaye Traore
authored andcommitted
fix: use correct name for role guard and delete useless condition
1 parent ab492de commit 17d1fa6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/guards/role.guard.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import { RoleMatchingMode } from '../constants'
1515
import KeycloakConnect from 'keycloak-connect'
1616

1717
@Injectable()
18-
export class Roleuard implements CanActivate {
19-
logger = new Logger(Roleuard.name)
18+
export class RoleGuard implements CanActivate {
19+
logger = new Logger(RoleGuard.name)
2020

2121
constructor(
2222
@Inject(KeycloakService)
@@ -41,7 +41,7 @@ export class Roleuard implements CanActivate {
4141
const roleDefinition = this.reflector.get<RoleDecoratorOption>(META_ROLES, context.getHandler())
4242

4343
// If no resource type is defined as class decorator, emit.
44-
if (!roleDefinition || !roleDefinition?.roles?.length) {
44+
if (!roleDefinition?.roles?.length) {
4545
return true
4646
}
4747

0 commit comments

Comments
 (0)