Adapt 2FA changes to glitch-soc's theming system

remotes/1727458204337373841/tmp_refs/heads/signup-info-prompt
Thibaut Girka 2020-08-30 17:26:18 +02:00
parent a340e653df
commit a68ec50e4e
6 changed files with 7 additions and 5 deletions

View File

@ -85,6 +85,10 @@ module Settings
private
def set_pack
use_pack 'auth'
end
def require_otp_enabled
unless current_user.otp_enabled?
flash[:error] = t('webauthn_credentials.otp_required')

View File

@ -0,0 +1,2 @@
import './settings';
import './two_factor_authentication';

View File

@ -3,7 +3,7 @@
pack:
about:
admin: admin.js
auth: settings.js
auth: auth.js
common:
filename: common.js
stylesheet: true

View File

@ -1,8 +1,6 @@
- content_for :page_title do
= t('auth.login')
=javascript_pack_tag 'two_factor_authentication', integrity: true, crossorigin: 'anonymous'
- if @webauthn_enabled
= render partial: 'auth/sessions/two_factor/webauthn_form', locals: { hidden: @scheme_type != 'webauthn' }

View File

@ -12,5 +12,3 @@
.actions
= f.button :button, t('webauthn_credentials.add'), class: 'js-webauthn', type: :submit
= javascript_pack_tag 'two_factor_authentication', integrity: true, crossorigin: 'anonymous'