Skip to content
This repository has been archived by the owner on Mar 14, 2019. It is now read-only.

Force SSL in prod #50

Merged
merged 1 commit into from
Oct 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ class ApplicationController < ActionController::Base
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception

force_ssl if: :ssl_configured?

def ssl_configured?
Rails.env.production?
end

unless Rails.env.test?
before_filter :authenticate
end
Expand Down