Force set omniauth full_host for redirection

This commit is contained in:
2020-03-05 19:18:44 -05:00
parent cf464aed8d
commit 8288595b3f
4 changed files with 7 additions and 3 deletions
@@ -10,9 +10,9 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
@user = User.find_for_oauth(request.env["omniauth.auth"], current_user)
if @user.persisted?
flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => @user.provider.to_s.capitalize
flash[:notice] = I18n.t "devise.omniauth_callbacks.success", kind: @user.provider.to_s.capitalize
sign_in @user
redirect_to user_obtain_token_path, :event => :authentication, :current_user => @user
redirect_to user_obtain_token_path, event: :authentication, current_user: @user
else
session["devise.facebook_data"] = request.env["omniauth.auth"]
Rails.logger.error("Failed to persist user: #{@user.errors.full_messages.join(', ')}")