Fix haml-lint InstanceVariables
rule for auth/sessions/two_factor/o… (#27372)
This commit is contained in:
parent
85b36fbbd3
commit
d4c2dca874
4 changed files with 10 additions and 8 deletions
|
@ -5,6 +5,7 @@ module TwoFactorAuthenticationConcern
|
|||
|
||||
included do
|
||||
prepend_before_action :authenticate_with_two_factor, if: :two_factor_enabled?, only: [:create]
|
||||
helper_method :webauthn_enabled?
|
||||
end
|
||||
|
||||
def two_factor_enabled?
|
||||
|
@ -87,4 +88,10 @@ module TwoFactorAuthenticationConcern
|
|||
|
||||
set_locale { render :two_factor }
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def webauthn_enabled?
|
||||
@webauthn_enabled
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
= javascript_pack_tag 'two_factor_authentication', crossorigin: 'anonymous'
|
||||
|
||||
- if @webauthn_enabled
|
||||
- if webauthn_enabled?
|
||||
= render partial: 'auth/sessions/two_factor/webauthn_form', locals: { hidden: @scheme_type != 'webauthn' }
|
||||
|
||||
= render partial: 'auth/sessions/two_factor/otp_authentication_form', locals: { hidden: @scheme_type != 'totp' }
|
||||
|
|
|
@ -13,6 +13,6 @@
|
|||
- if Setting.site_contact_email.present?
|
||||
%p.hint.subtle-hint= t('users.otp_lost_help_html', email: mail_to(Setting.site_contact_email, nil))
|
||||
|
||||
- if @webauthn_enabled
|
||||
- if webauthn_enabled?
|
||||
.form-footer
|
||||
= link_to(t('auth.link_to_webauth'), '#', id: 'link-to-webauthn')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue