From b828a9d6c6ed0fdb2776278637915402b0e7beb9 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 20 Dec 2019 08:26:22 -0500 Subject: [PATCH] fixes redirect loop Redirecting users to `/account/sign_in` caused a redirect loop which crashed the page, but still adds them to the `users` table correctly.. Forcing users to the `root_path` solves the redirect loop. --- app/controllers/users/omniauth_callbacks_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb index 8d0f80dd..3cc3c621 100644 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ b/app/controllers/users/omniauth_callbacks_controller.rb @@ -35,8 +35,7 @@ module Users openid.save! sign_in user - redirect_to request.env['omniauth.origin'] || root_path, - notice: "#{user.email} signed in successfully with #{provider}" + redirect_to root_path, notice: "#{user.email} signed in successfully with #{provider}" rescue => e flash[:error] = e.message redirect_back_or_to new_user_registration_path