feat: Implement real-time messaging module with REST API endpoints and WebSocket gateway.
This commit is contained in:
@@ -14,6 +14,11 @@ export class JwtAuthGuard extends AuthGuard('jwt') {
|
||||
}
|
||||
|
||||
canActivate(context: ExecutionContext) {
|
||||
// Skip WebSocket connections - they have their own auth in the gateway
|
||||
if (context.getType() === 'ws') {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if route is marked as public
|
||||
const isPublic = this.reflector.getAllAndOverride<boolean>(IS_PUBLIC_KEY, [
|
||||
context.getHandler(),
|
||||
|
||||
@@ -13,6 +13,11 @@ export class RolesGuard implements CanActivate {
|
||||
constructor(private reflector: Reflector) {}
|
||||
|
||||
canActivate(context: ExecutionContext): boolean {
|
||||
// Skip WebSocket connections - they have their own auth in the gateway
|
||||
if (context.getType() === 'ws') {
|
||||
return true;
|
||||
}
|
||||
|
||||
const requiredRoles = this.reflector.getAllAndOverride<UserRole[]>(
|
||||
ROLES_KEY,
|
||||
[context.getHandler(), context.getClass()],
|
||||
|
||||
Reference in New Issue
Block a user