module Blog
  class Admin::ApplicationController < ActionController::Base
    layout "blog/admin"

    force_ssl if: :ssl_configured?
    protect_from_forgery with: :exception

    def ssl_configured?
      Rails.env.production?
    end
  end
end

module Blog
  class Admin::ApplicationController < ActionController::Base
    layout "blog/admin"

    force_ssl if: :ssl_configured?
    protect_from_forgery with: :exception

    # Require authentication if in host application and devise is present.
    #
    # Otherwise authentication not required in testing environment.
    before_filter :authenticate_user! if defined? authenticate_user!

    def ssl_configured?
      Rails.env.production?
    end
  end
end

Add authentication requirement for blog/admin
Add authentication requirement for blog/admin

Require authentication for blog/admin if it can be found, since it is up
to the host application to define Devise. Otherwise, leave it out for
stand-alone engine testability.
