Skip to content

Commit 0e88f51

Browse files
committed
Fix hasLicense being set
1 parent 1964a64 commit 0e88f51

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

enterprise/coderd/coderd.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ func (api *API) updateEntitlements(ctx context.Context) error {
128128
now := time.Now()
129129

130130
// Default all entitlements to be disabled.
131+
hasLicense := false
131132
activeUsers := codersdk.Feature{
132133
Enabled: false,
133134
Entitlement: codersdk.EntitlementNotEntitled,
@@ -141,7 +142,7 @@ func (api *API) updateEntitlements(ctx context.Context) error {
141142
slog.F("id", l.ID), slog.Error(err))
142143
continue
143144
}
144-
api.hasLicense = true
145+
hasLicense = true
145146
entitlement := codersdk.EntitlementEntitled
146147
if now.After(claims.LicenseExpires.Time) {
147148
// if the grace period were over, the validation fails, so if we are after
@@ -177,6 +178,7 @@ func (api *API) updateEntitlements(ctx context.Context) error {
177178
api.AGPL.Auditor.Store(auditor)
178179
}
179180

181+
api.hasLicense = hasLicense
180182
api.activeUsers = activeUsers
181183
api.auditLogs = auditLogs
182184

0 commit comments

Comments
 (0)