Adapt 2FA changes to glitch-soc's theming system
This commit is contained in:
		
							parent
							
								
									6b224ecaed
								
							
						
					
					
						commit
						22eb51447d
					
				
					 6 changed files with 7 additions and 5 deletions
				
			
		| 
						 | 
					@ -85,6 +85,10 @@ module Settings
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      private
 | 
					      private
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      def set_pack
 | 
				
			||||||
 | 
					        use_pack 'auth'
 | 
				
			||||||
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      def require_otp_enabled
 | 
					      def require_otp_enabled
 | 
				
			||||||
        unless current_user.otp_enabled?
 | 
					        unless current_user.otp_enabled?
 | 
				
			||||||
          flash[:error] = t('webauthn_credentials.otp_required')
 | 
					          flash[:error] = t('webauthn_credentials.otp_required')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								app/javascript/core/auth.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								app/javascript/core/auth.js
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,2 @@
 | 
				
			||||||
 | 
					import './settings';
 | 
				
			||||||
 | 
					import './two_factor_authentication';
 | 
				
			||||||
| 
						 | 
					@ -3,7 +3,7 @@
 | 
				
			||||||
pack:
 | 
					pack:
 | 
				
			||||||
  about:
 | 
					  about:
 | 
				
			||||||
  admin: admin.js
 | 
					  admin: admin.js
 | 
				
			||||||
  auth: settings.js
 | 
					  auth: auth.js
 | 
				
			||||||
  common:
 | 
					  common:
 | 
				
			||||||
    filename: common.js
 | 
					    filename: common.js
 | 
				
			||||||
    stylesheet: true
 | 
					    stylesheet: true
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,8 +1,6 @@
 | 
				
			||||||
- content_for :page_title do
 | 
					- content_for :page_title do
 | 
				
			||||||
  = t('auth.login')
 | 
					  = t('auth.login')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=javascript_pack_tag 'two_factor_authentication', integrity: true, 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/webauthn_form', locals: { hidden: @scheme_type != 'webauthn' }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,5 +12,3 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .actions
 | 
					  .actions
 | 
				
			||||||
    = f.button :button, t('webauthn_credentials.add'), class: 'js-webauthn', type: :submit
 | 
					    = f.button :button, t('webauthn_credentials.add'), class: 'js-webauthn', type: :submit
 | 
				
			||||||
 | 
					 | 
				
			||||||
= javascript_pack_tag 'two_factor_authentication', integrity: true, crossorigin: 'anonymous'
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue