Skip to content

Commit 77d4c7a

Browse files
committed
fix: Remove audit warning if unlicensed
Fixes #4383.
1 parent 1386465 commit 77d4c7a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

enterprise/coderd/coderd.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,11 @@ func (api *API) serveEntitlements(rw http.ResponseWriter, r *http.Request) {
265265
// Audit logs
266266
resp.Features[codersdk.FeatureAuditLog] = codersdk.Feature{
267267
Entitlement: entitlements.auditLogs,
268-
Enabled: api.AuditLogging,
268+
Enabled: entitlements.hasLicense && api.AuditLogging,
269269
}
270-
if api.AuditLogging {
270+
// Audit logging is enabled by default. We don't want to display
271+
// a warning if they don't have a license.
272+
if entitlements.hasLicense && api.AuditLogging {
271273
if entitlements.auditLogs == codersdk.EntitlementNotEntitled {
272274
resp.Warnings = append(resp.Warnings,
273275
"Audit logging is enabled but your license is not entitled to this feature.")

0 commit comments

Comments
 (0)