Closed drmwndr closed 5 years ago
Hi @drmwndr , are you initializing this in a Rails app, the Rails console, or Rails tests?
Hi! I've triend via console and on App running over development environment. Thank you for your interest! :)
Em qui, 21 de fev de 2019 às 12:00, Tieg Zaharia notifications@github.com escreveu:
Hi @drmwndr https://github.com/drmwndr , are you initializing this in a Rails app, the Rails console, or Rails tests?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/binarylogic/authlogic/issues/662#issuecomment-466051073, or mute the thread https://github.com/notifications/unsubscribe-auth/AD-0FvtdxpPWuGtqv06oqtjA3rBDMwK-ks5vPsA7gaJpZM4bHfwF .
Ok, I usually have this [fix] in my ~/.irbrc
:
controller.request = ActionController::TestRequest.new
Authlogic::Session::Base.controller = Authlogic::ControllerAdapters::RailsAdapter.new(controller)
Sidenote: wondering if there's a reason we don't always just do this in a Railtie since everyone runs into this problem.
If your app was set up with Rails 5 API (using rails new foo --api
), you may need to update ApplicationController.
ApplicationController < ActionController::API
should be updated to
ApplicationController < ActionController::Base
ActionController::Base
has a few modules that (I imagine) AuthLogic requires that ActionController::API
lacks. I went through as many combinations as I could but couldn't find the correct set of modules to include.
Modules in ActionController::Base https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/base.rb
Modules in ActionController::API https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/api.rb
Closing, looks like this conversation is complete. If there's a concrete bug report or feature that someone can commit to working on, please open a new issue.
I've created a base authentication system using Instructions of Authlogic ReadMe GitHub Repository. Now when i call UserSessions.new the following message is showed: " Authlogic::Session::Activation::NotActivatedError (You must activate the Authlogic::Session::Base.controller with a controller object before creating objects) "
I've readed some topics here about it, but none of the proposed solutions worked. Can someone help?
Rails 5.2.2, ruby 2.6.1