Skip to content

Commit

Permalink
Fix rubocop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
klaustopher committed Jun 26, 2024
1 parent db58014 commit 38c0ccb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def self.try_to_login(login, password, session = nil)

# Tries to authenticate a user in the database via external auth source
# or password stored in the database
def self.try_authentication_for_existing_user(user, password, session = nil)
def self.try_authentication_for_existing_user(user, password, session = nil) # rubocop:disable Metrics/PerceivedComplexity
activate_user! user, session if session

return nil if !user.active? || OpenProject::Configuration.disable_password_login?
Expand Down Expand Up @@ -255,7 +255,7 @@ def self.try_authentication_and_create_user(login, password)

# Returns the user who matches the given autologin +key+ or nil
def self.try_to_autologin(key)
token = Token::AutoLogin.find_by_plaintext_value(key)
token = Token::AutoLogin.find_by_plaintext_value(key) # rubocop:disable Rails/DynamicFindBy
# Make sure there's only 1 token that matches the key
if token && ((token.created_at > Setting.autologin.to_i.day.ago) && token.user && token.user.active?)
token.user
Expand Down Expand Up @@ -525,7 +525,7 @@ def missing_authentication_method?

# Returns the anonymous user. If the anonymous user does not exist, it is created. There can be only
# one anonymous user per database.
def self.anonymous
def self.anonymous # rubocop:disable Metrics/AbcSize
RequestStore[:anonymous_user] ||= begin
anonymous_user = AnonymousUser.first

Expand Down

0 comments on commit 38c0ccb

Please sign in to comment.