]> cat aescling's git repositories - mastodon.git/commitdiff
If signed in, redirect autofollow invite to profile page (#7956)
authorEugen Rochko <eugen@zeonfederated.com>
Thu, 5 Jul 2018 18:57:35 +0000 (20:57 +0200)
committerGitHub <noreply@github.com>
Thu, 5 Jul 2018 18:57:35 +0000 (20:57 +0200)
Fix #7944

app/controllers/auth/registrations_controller.rb

index c095411c12d99a5860351e147042d33565a20d86..58961554e6b7fe46cc86b2725eed7c6d823f49ce 100644 (file)
@@ -39,6 +39,16 @@ class Auth::RegistrationsController < Devise::RegistrationsController
     new_user_session_path
   end
 
+  def after_sign_in_path_for(_resource)
+    set_invite
+
+    if @invite&.autofollow?
+      short_account_path(@invite.user.account)
+    else
+      super
+    end
+  end
+
   def after_inactive_sign_up_path_for(_resource)
     new_user_session_path
   end