Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Use new active method to determine token

Klaus Zanders4fd3546558f2
diff --git a/app/models/enterprise_token.rb b/app/models/enterprise_token.rb
index f32b508d742..eaedf8f0a3a 100644
--- a/app/models/enterprise_token.rb
+++ b/app/models/enterprise_token.rb
@@ -96,13 +96,13 @@ class EnterpriseToken < ApplicationRecord
end
def set_active_tokens
- # although we use the `active` scope here, we still need to filter out expired tokens
+ # although we use the `active` scope here, we still need to filter out non-active tokens
# as not all token validity period is extracted into the DB
EnterpriseToken
.active
.order(Arel.sql("created_at DESC"))
.to_a
- .reject(&:expired?)
+ .select { it.active? && !it.invalid_domain? }
end
def clear_current_tokens_cache