Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

chore: change in error message on register (#1068)

Ankit Nayan67b429084638
diff --git a/pkg/query-service/auth/auth.go b/pkg/query-service/auth/auth.go
index 9c958ff7e8..1a5775334a 100644
--- a/pkg/query-service/auth/auth.go
+++ b/pkg/query-service/auth/auth.go
@@ -125,7 +125,11 @@ func validateInvite(ctx context.Context, req *RegisterRequest) (*model.Invitatio
return nil, errors.Wrap(err.Err, "Failed to read from DB")
}
- if invitation == nil || invitation.Token != req.InviteToken {
+ if invitation == nil {
+ return nil, ErrorAskAdmin
+ }
+
+ if invitation.Token != req.InviteToken {
return nil, ErrorInvalidInviteToken
}
diff --git a/pkg/query-service/auth/utils.go b/pkg/query-service/auth/utils.go
index 5e13c32b8f..4de59ea2c0 100644
--- a/pkg/query-service/auth/utils.go
+++ b/pkg/query-service/auth/utils.go
@@ -15,6 +15,7 @@ var (
ErrorInvalidRole = errors.New("Invalid role")
ErrorInvalidInviteToken = errors.New("Invalid invite token")
+ ErrorAskAdmin = errors.New("You are not allowed to create an account. Please ask your admin to send an invite link")
)
func randomHex(sz int) (string, error) {