sorcery

Sorcery and Simple Form implementation

百般思念 提交于 2020-01-03 02:33:09
问题 long time reader first time user. I'm putting together my first RoR application and I've isolated everything my app should use down to:- Sorcery Omniauth CanCan twitter-bootstrap (converted to sass) and Simple Forms. Clean, clear and simple....Not. Cannot for the life of me integrate (what would seem to be the most simplest of tasks) simple forms with a Sorcery "Login" without getting errors on the 'remember_me' field. Simple forms doesn't have a simple_form_tag (only simple_form_for) option

Sorcery Gem: @user.activate! is raising a “ActiveRecord::RecordNotSaved” exception in staging server but not in my local machine

血红的双手。 提交于 2019-12-20 06:04:16
问题 Even the activation mail is being sent, but this error pops up. The Full trace is: activerecord (3.2.2) lib/active_record/persistence.rb:104:in `save!' activerecord (3.2.2) lib/active_record/validations.rb:56:in `save!' activerecord (3.2.2) lib/active_record/attribute_methods/dirty.rb:33:in `save!' activerecord (3.2.2) lib/active_record/transactions.rb:246:in `block in save!' activerecord (3.2.2) lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'

Rails admin with Sorcery

血红的双手。 提交于 2019-12-12 11:50:25
问题 I'm trying to install the Rails Admin Gem using Sorcery for authentication instead of Devise. Rails admin does provide a hook that you can use to attach your own authentication method. Here is the example they provide in their docs (using warden): config.authenticate_with do warden.authenticate! :scope => :admin end config.current_user_method { current_admin } I'm guessing that inside the block I need to reference the before_filter that Sorcery uses to authenticate users, which would be

How to implement admin becoming another user temporarily?

女生的网名这么多〃 提交于 2019-12-11 17:27:15
问题 I have a traditional Rails 4 app with a User model and Sorcery for authentication. The User model has an 'admin' flag. What's the best way to implement the ability for admins to temporarily become another user (in order to see what the user sees to help debug a problem) and then pop back to being their original, admin-enabled user? 回答1: here's a implementation: http://robots.thoughtbot.com/how-to-masquerade-as-another-user-to-see-how-they-use-yo I think this was what you were looking for 回答2: