Sha256: 279e7ab35fb3ae618ac5b1fd86316c88054b277b76bcd1f5ea8bd4094984536a
Contents?: true
Size: 690 Bytes
Versions: 8
Compression:
Stored size: 690 Bytes
Contents
# frozen_string_literal: true module Alchemy module SSLProtection private # Enforce ssl for login and all admin modules. # # Default is +false+ # # === Usage # # # config/alchemy/config.yml # ... # require_ssl: true # ... # # === Note # # You have to create a ssl certificate # if you want to use the ssl protection. # def ssl_required? !Rails.env.test? && Config.get(:require_ssl) end # Redirects current request to https. def enforce_ssl redirect_to url_for(request.params.merge(protocol: "https")) end deprecate :enforce_ssl, deprecator: Alchemy::Deprecation end end
Version data entries
8 entries across 8 versions & 1 rubygems