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

Check active state of user during SQL query

Jan Sandbrink1e97636b91cf
diff --git a/lib_static/open_project/authentication/strategies/warden/doorkeeper_oauth.rb b/lib_static/open_project/authentication/strategies/warden/doorkeeper_oauth.rb
index bd336317b5e..4393e6a5e07 100644
--- a/lib_static/open_project/authentication/strategies/warden/doorkeeper_oauth.rb
+++ b/lib_static/open_project/authentication/strategies/warden/doorkeeper_oauth.rb
@@ -42,8 +42,8 @@ module OpenProject
end
def authenticate_user(id)
- user = id && User.find_by(id:)
- if user&.active?
+ user = id && User.active.find_by(id:)
+ if user
success!(user)
else
fail_with_header!(error: "invalid_token")