Note that there are some explanatory texts on larger screens.

plurals
  1. POAuthlogic and Invalid Sessions
    primarykey
    data
    text
    <p><strong>Background</strong>:</p> <p>I've inherited an older Rails application which I'm attempting to setup a local copy and have run into a problem with the Authlogic gem used for authentication. The setup is as follows: </p> <ul> <li>Rails 2.3.18 application which is a legacy application</li> <li>Using Authlogic for authentication.</li> <li>Unable to create a valid session</li> </ul> <p><strong>Testing</strong>:</p> <p>The application has a User model and it's constructed using the simple steps outlined in <a href="http://rdoc.info/github/binarylogic/authlogic#Quick_Rails_example" rel="nofollow">AuthLogic Quick Rails example</a>. The login step routes to the UserSessions controller to take the user parameters (login and password), creates a new session then attempts to save the session, like so:</p> <pre><code>UserSessionsController.rb .... @user_session = current_account.user_sessions.new(params[:user_session]) if @user_session.save # login success .... else # login failure end </code></pre> <p>It's the last step that's failing. And when I check the errors on the @user_session object I'm getting the string "<strong>Login is not valid</strong>"</p> <p>Additionally I've tested this via the rails console and followed the instructions as per the article: <a href="http://www.tatvartha.com/2009/09/working-with-authlogic-in-scriptconsole/" rel="nofollow">Working with Authlogic in console</a>. This basically requires that in the console you execute:</p> <pre><code>Authlogic::Session::Base.controller = Authlogic::ControllerAdapters::RailsAdapter.new(self) </code></pre> <p>Using this method when I simulate the UserSession creation via a call like:</p> <pre><code>us=UserSession.new(:login=&gt; "user@gmail.com", :password =&gt; "secret") </code></pre> <p>I get the error: <code>#&lt;UserSession: no credentials provided&gt;</code></p> <p>Now in both cases the user identity exists in the DB.</p> <p>Any tips/suggestions for fault diagnosis would be most welcome !</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload