Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

fixed selfhosted auth

Blue Mouse53cedc365fed
diff --git a/src/common/guards/roles.guard.ts b/src/common/guards/roles.guard.ts
index 7889f5243..1c95552b0 100644
--- a/src/common/guards/roles.guard.ts
+++ b/src/common/guards/roles.guard.ts
@@ -6,6 +6,7 @@ import { ExtractJwt } from 'passport-jwt'
import { UserService } from '../../user/user.service'
import { User } from '../../user/entities/user.entity'
+import { isSelfhosted } from '../constants'
@Injectable()
export class RolesGuard implements CanActivate {
@@ -17,7 +18,7 @@ export class RolesGuard implements CanActivate {
async canActivate(context: ExecutionContext): Promise<boolean> {
const secret = process.env.JWT_SECRET
const roles = this.reflector.get<string[]>('roles', context.getHandler())
- if (!roles) {
+ if (!roles || isSelfhosted) {
return true
}