Known incompatibilities

mariozig edited this page Dec 28, 2014 · 13 revisions

paper_trail - Sorcery versions v0.6.1 and previous do not play nice with paper_trail due to a before_filter that paper_trail adds behind the scenes that calls 'current_user' a bit too early for sorcery. This issue might be solved by calling

    prepend_before_filter :require_login

instead of the usual

    before_filter :require_login

Though this hasn't been proven (please report success).

refinerycms

    # Gemfile  # works
    gem 'sorcery'
    gem 'refinerycms'

The 'sorcery' gem need to be placed before 'refinerycms' gem, otherwise it won't work.

under the hood, for example

    # Gemfile  # don't work in production mode
    gem 'refinerycms'
    gem 'sorcery'

when require 'refinerycms', it loads User model (I don't know how), which calls User.authenticates_with_sorcery!, but it's not ready (means user_config is not loaded). We need first require 'sorcery', which call ActionController::Base.send(:include, Sorcery::Controller), it prepares user_config for User.authenticates_with_sorcery!.

rails_admin

List of potential problems and suggested solutions are provided in RailsAdmin wiki

rails-api

In order to be able to use Sorcery with ActionController::API class from Rails-API project, you need to manually include Sorcery::Controller module in your controller.

class ApplicationController < ActionController::API
  include Sorcery::Controller
end