Fix `Naming/AccessorMethodName` cop (#25924)
This commit is contained in:
parent
b8b2470cf8
commit
5134fc65e2
|
@ -151,10 +151,6 @@ Metrics/CyclomaticComplexity:
|
||||||
Metrics/PerceivedComplexity:
|
Metrics/PerceivedComplexity:
|
||||||
Max: 27
|
Max: 27
|
||||||
|
|
||||||
Naming/AccessorMethodName:
|
|
||||||
Exclude:
|
|
||||||
- 'app/controllers/auth/sessions_controller.rb'
|
|
||||||
|
|
||||||
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
||||||
# CheckDefinitionPathHierarchyRoots: lib, spec, test, src
|
# CheckDefinitionPathHierarchyRoots: lib, spec, test, src
|
||||||
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
||||||
|
|
|
@ -124,7 +124,7 @@ class Auth::SessionsController < Devise::SessionsController
|
||||||
redirect_to new_user_session_path, alert: I18n.t('devise.failure.timeout')
|
redirect_to new_user_session_path, alert: I18n.t('devise.failure.timeout')
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_attempt_session(user)
|
def register_attempt_in_session(user)
|
||||||
session[:attempt_user_id] = user.id
|
session[:attempt_user_id] = user.id
|
||||||
session[:attempt_user_updated_at] = user.updated_at.to_s
|
session[:attempt_user_updated_at] = user.updated_at.to_s
|
||||||
end
|
end
|
||||||
|
|
|
@ -75,7 +75,7 @@ module TwoFactorAuthenticationConcern
|
||||||
end
|
end
|
||||||
|
|
||||||
def prompt_for_two_factor(user)
|
def prompt_for_two_factor(user)
|
||||||
set_attempt_session(user)
|
register_attempt_in_session(user)
|
||||||
|
|
||||||
@body_classes = 'lighter'
|
@body_classes = 'lighter'
|
||||||
@webauthn_enabled = user.webauthn_enabled?
|
@webauthn_enabled = user.webauthn_enabled?
|
||||||
|
|
Loading…
Reference in New Issue