Howto enforce SSL on all front-end pages in Spree 0.11.x

In Spree production mode, SSL mode is activated if running with /admin (backend) but it’s not activated on front-end pages (non /admin). So how to enforce SSL on every frontend pages? Easy, simply extend Spree:BaseController like this in your SiteExtension:

class SiteExtension < Spree::Extension
  def activate
    Spree::BaseController.class_eval do
      protected
      def ssl_required?
        ssl_supported?
      end
    end
  end
end
Advertisements

About Jones Lee

Nothing much about me..

2 responses to “Howto enforce SSL on all front-end pages in Spree 0.11.x

  1. Con vit

    Where is your deepest feeling?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: