]> cat aescling's git repositories - mastodon.git/commitdiff
Adapt 2FA changes to glitch-soc's theming system
authorThibaut Girka <thib@sitedethib.com>
Sun, 30 Aug 2020 15:26:18 +0000 (17:26 +0200)
committerThibaut Girka <thib@sitedethib.com>
Sun, 30 Aug 2020 15:26:18 +0000 (17:26 +0200)
app/controllers/settings/two_factor_authentication/webauthn_credentials_controller.rb
app/javascript/core/auth.js [new file with mode: 0644]
app/javascript/core/theme.yml
app/javascript/core/two_factor_authentication.js [moved from app/javascript/packs/two_factor_authentication.js with 100% similarity]
app/views/auth/sessions/two_factor.html.haml
app/views/settings/two_factor_authentication/webauthn_credentials/new.html.haml

index a19c604f3bb2f50bf81ecd111b19a03b7759fe7f..ee539278519df2f3efe3bc0923ab8e20de3fcfc5 100644 (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')
diff --git a/app/javascript/core/auth.js b/app/javascript/core/auth.js
new file mode 100644 (file)
index 0000000..ca04730
--- /dev/null
@@ -0,0 +1,2 @@
+import './settings';
+import './two_factor_authentication';
index dc641772c57f126eb415504c592baa09ba7a268d..b9144e43aa525f0dfc8da2bc870509d395f0957d 100644 (file)
@@ -3,7 +3,7 @@
 pack:
   about:
   admin: admin.js
-  auth: settings.js
+  auth: auth.js
   common:
     filename: common.js
     stylesheet: true
index f2f6fe19d58d0bed7cf4fde1938a550fad07ee5c..1867ec7f8a140938473ab6860c669746dc0c567e 100644 (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' }
 
index 0b23bb6897a319609b1c4a4e9715d4fd50eb1244..c5a323ee50b72d0a598387b896a496b551fa9aa9 100644 (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'