]> cat aescling's git repositories - mastodon.git/commitdiff
Merge branch 'master' into glitch-soc/merge-upstream
authorThibaut Girka <thib@sitedethib.com>
Fri, 13 Nov 2020 23:30:36 +0000 (00:30 +0100)
committerThibaut Girka <thib@sitedethib.com>
Fri, 13 Nov 2020 23:30:36 +0000 (00:30 +0100)
Conflicts:
- `app/controllers/concerns/sign_in_token_authentication_concern.rb`:
  Conflict caused because of glitch-soc's theming system.
  Took upstream's new code and applied the theming system changes on top
  of it.
- `app/controllers/concerns/two_factor_authentication_concern.rb`:
  Conflict caused because of glitch-soc's theming system.
  Took upstream's new code and applied the theming system changes on top
  of it.

1  2 
app/controllers/auth/sessions_controller.rb
app/controllers/concerns/sign_in_token_authentication_concern.rb
app/controllers/concerns/two_factor_authentication_concern.rb
app/models/user.rb
streaming/index.js

index 1cf6a0a59552373768d86b0a7be35704b74cb7e8,13d158c67613a8ed9f0ab8b450eff2e31db6d271..548832b21b0ae9af672455b9733a20e151bc0b6d
@@@ -7,9 -7,8 +7,10 @@@ class Auth::SessionsController < Devise
  
    skip_before_action :require_no_authentication, only: [:create]
    skip_before_action :require_functional!
+   skip_before_action :update_user_sign_in
  
 +  prepend_before_action :set_pack
 +
    include TwoFactorAuthenticationConcern
    include SignInTokenAuthenticationConcern
  
index f5178930b6bb8ef2712f6bf6bdb66848a855c57a,3c95a4afd2cf664cd465c0a40f2e3b9683bf3f7f..51ebcb115267f2022dabb302357bab8593935a8a
@@@ -42,11 -44,10 +44,11 @@@ module SignInTokenAuthenticationConcer
        UserMailer.sign_in_token(user, request.remote_ip, request.user_agent, Time.now.utc.to_s).deliver_later!
      end
  
-     set_locale do
-       session[:attempt_user_id] = user.id
-       use_pack 'auth'
-       @body_classes = 'lighter'
-       render :sign_in_token
-     end
+     set_attempt_session(user)
++    use_pack 'auth'
+     @body_classes = 'lighter'
+     set_locale { render :sign_in_token }
    end
  end
index 6b043a804fbafab5b30e8d6bdfae52ea283f2fa9,4d4ccf49c8ce67d8f9778563f9190335d98b9edd..4800db34800a5cad98e2827f70dc43d0ce4733f3
@@@ -71,17 -73,18 +73,20 @@@ module TwoFactorAuthenticationConcer
    end
  
    def prompt_for_two_factor(user)
-     set_locale do
-       session[:attempt_user_id] = user.id
-       use_pack 'auth'
-       @body_classes = 'lighter'
-       @webauthn_enabled = user.webauthn_enabled?
-       @scheme_type = if user.webauthn_enabled? && user_params[:otp_attempt].blank?
-                        'webauthn'
-                      else
-                        'totp'
-                      end
-       render :two_factor
+     set_attempt_session(user)
++    use_pack 'auth'
++
+     @body_classes     = 'lighter'
+     @webauthn_enabled = user.webauthn_enabled?
+     @scheme_type      = begin
+       if user.webauthn_enabled? && user_params[:otp_attempt].blank?
+         'webauthn'
+       else
+         'totp'
+       end
      end
+     set_locale { render :two_factor }
    end
  end
Simple merge
Simple merge