Skip to content

Changing default authentication

GBH edited this page Sep 1, 2011 · 2 revisions

Do you have other authentication system in place (like Devise, AuthLogic, etc) and wish to use that? For that, you will need to create a module that does the authentication check and make ComfortableMexicanSofa use it. For example:

module CmsDeviseAuth
  def authenticate
    unless current_user && current_user.admin?
      redirect_to new_user_session_path
    end
  end
end

You can put this module in /config/initializers/comfortable_mexican_sofa.rb and change authentication method:

config.admin_auth = 'CmsDeviseAuth'

Now to access Sofa's admin area users will be authenticated against your existing authentication system.

Something went wrong with that request. Please try again.