Return force_ssl to the controller (#2380)
This commit is contained in:
parent
1e2a5dded7
commit
a0dd90a397
2 changed files with 6 additions and 8 deletions
|
@ -5,6 +5,8 @@ class ApplicationController < ActionController::Base
|
|||
# For APIs, you may want to use :null_session instead.
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
force_ssl if: :https_enabled?
|
||||
|
||||
include Localized
|
||||
|
||||
helper_method :current_account
|
||||
|
@ -24,6 +26,10 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
private
|
||||
|
||||
def https_enabled?
|
||||
Rails.env.production? && ENV['LOCAL_HTTPS'] == 'true'
|
||||
end
|
||||
|
||||
def store_current_location
|
||||
store_location_for(:user, request.url)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue