about summary refs log tree commit diff
path: root/app/controllers/concerns
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-12-16 16:19:28 +0100
committerClaire <claire.github-309c@sitedethib.com>2021-12-16 16:20:44 +0100
commitb2526316f54839968c821295e63066beaa425159 (patch)
treeb13a52c19923edfb80518f82ac060f296e68aeb2 /app/controllers/concerns
parentd911c17f521d6b13861caa886715a50b644007a1 (diff)
parent2aafa5b4e7a83ce8195cd739f1233a52ab060db7 (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `app/views/admin/pending_accounts/index.html.haml`:
  Removed upstream, while it had glitch-soc-specific changes to accomodate
  for glitch-soc's theming system.
  Removed the file.

Additional changes:
- `app/views/admin/accounts/index.html.haml':
  Accomodate for glitch-soc's theming system.
Diffstat (limited to 'app/controllers/concerns')
-rw-r--r--app/controllers/concerns/accountable_concern.rb4
-rw-r--r--app/controllers/concerns/two_factor_authentication_concern.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/concerns/accountable_concern.rb b/app/controllers/concerns/accountable_concern.rb
index 3cdcffc51..87d62478d 100644
--- a/app/controllers/concerns/accountable_concern.rb
+++ b/app/controllers/concerns/accountable_concern.rb
@@ -3,7 +3,7 @@
 module AccountableConcern
   extend ActiveSupport::Concern
 
-  def log_action(action, target)
-    Admin::ActionLog.create(account: current_account, action: action, target: target)
+  def log_action(action, target, options = {})
+    Admin::ActionLog.create(account: current_account, action: action, target: target, recorded_changes: options.stringify_keys)
   end
 end
diff --git a/app/controllers/concerns/two_factor_authentication_concern.rb b/app/controllers/concerns/two_factor_authentication_concern.rb
index 39dd71fca..c9477a1d4 100644
--- a/app/controllers/concerns/two_factor_authentication_concern.rb
+++ b/app/controllers/concerns/two_factor_authentication_concern.rb
@@ -57,7 +57,7 @@ module TwoFactorAuthenticationConcern
 
     if valid_webauthn_credential?(user, webauthn_credential)
       on_authentication_success(user, :webauthn)
-      render json: { redirect_path: root_path }, status: :ok
+      render json: { redirect_path: after_sign_in_path_for(user) }, status: :ok
     else
       on_authentication_failure(user, :webauthn, :invalid_credential)
       render json: { error: t('webauthn_credentials.invalid_credential') }, status: :unprocessable_entity