-
Notifications
You must be signed in to change notification settings - Fork 228
Known incompatibilities
Rubies - Sorcery was tested on ruby 1.9.2 and should be fully compatible with it. Other rubies were not yet tested, though they might be in the future.
Rails - Rails 3+ is supported. There are currently no plans to support Rails 2.
Single Table Inheritance - This ActiveRecord feature doesn't play nice with Sorcery out of the box, but there is a hack that seems to work, and will probably get into a future release (Update: already supported see this and search page for "ActiveRecord's STI").
What we want to do is copy the configuration of User into its subclasses. This doesn't happen by default because @sorcery_config is attached to the User singleton object.
The solution is this:
class User < ActiveRecord::Base
...
def self.inherited(subclass)
subclass.class_eval do
class << self
attr_accessor :sorcery_config
end
end
subclass.sorcery_config = sorcery_config
super
end
authenticates_with_sorcery!
...
end
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 'rerinferycms' 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!
.
Meta
Using Sorcery
- Activity Logging
- Brute Force Protection
- DataMapper Support
- DelayedJob Integration
- Distinguish login failure reasons
- External
- External---Microsoft-Graph-authentication
- Fetching Currently Active Users
- HTTP Basic Auth
- Integration Testing
- OAuth Landing Page
- Password-less Activation
- Remember Me
- Reset Password
- Routes Constraints
- Session Timeout
- Simple Password Authentication
- Single Table Inheritance Support
- Testing Rails
- User Activation
Contributing to Sorcery