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.
This commit is contained in:
Brian 2019-12-20 08:26:22 -05:00 committed by GitHub
parent e7d98999fb
commit b828a9d6c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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