Force set omniauth full_host for redirection
This commit is contained in:
@@ -4,6 +4,7 @@ require 'capistrano/setup'
|
|||||||
# Includes default deployment tasks
|
# Includes default deployment tasks
|
||||||
require 'capistrano/deploy'
|
require 'capistrano/deploy'
|
||||||
require "capistrano/scm/git"
|
require "capistrano/scm/git"
|
||||||
|
install_plugin Capistrano::SCM::Git
|
||||||
# Includes tasks from other gems included in your Gemfile
|
# Includes tasks from other gems included in your Gemfile
|
||||||
#
|
#
|
||||||
# For documentation on these, see for example:
|
# For documentation on these, see for example:
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
|||||||
@user = User.find_for_oauth(request.env["omniauth.auth"], current_user)
|
@user = User.find_for_oauth(request.env["omniauth.auth"], current_user)
|
||||||
|
|
||||||
if @user.persisted?
|
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
|
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
|
else
|
||||||
session["devise.facebook_data"] = request.env["omniauth.auth"]
|
session["devise.facebook_data"] = request.env["omniauth.auth"]
|
||||||
Rails.logger.error("Failed to persist user: #{@user.errors.full_messages.join(', ')}")
|
Rails.logger.error("Failed to persist user: #{@user.errors.full_messages.join(', ')}")
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ Qwaiter::Application.configure do
|
|||||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
||||||
|
|
||||||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
||||||
config.force_ssl = true
|
#NOTE: DO NOT ACTIVATE force_ssl, this causes an infinite redirect loop and is handled by nginx
|
||||||
|
#config.force_ssl = true
|
||||||
|
|
||||||
# See everything in the log (default is :info)
|
# See everything in the log (default is :info)
|
||||||
# config.log_level = :debug
|
# config.log_level = :debug
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
OmniAuth.config.full_host = Rails.env.production? ? 'https://www.mozo.bar' : 'https://www.mozo.local'
|
||||||
|
|
||||||
Reference in New Issue
Block a user