GithubHelp home page GithubHelp logo

Comments (11)

NebJ avatar NebJ commented on May 27, 2024

You should do something like that:
@account_session = AccountSession.new(:username => 'my_username', :password => 'password')

from authlogic.

gavinhughes avatar gavinhughes commented on May 27, 2024

Doing that on the :new action will populate the form with (incorrect) data, which is not what we want on :new. We want the form to be blank. Calling AccountSession.new(:username => ' ', :password => ' ') gives the same "no credentials..." error. I'm sure the solution is simple, but I don't see it.

from authlogic.

translunar avatar translunar commented on May 27, 2024

Did you ever figure this out? I'm having a very similar problem.

from authlogic.

coop avatar coop commented on May 27, 2024

I agree that I am experiencing the same issue. I am currently running rails 3 beta 3 and authlogic 2.1.4.


# user_sessions_controller.rb
class UserSessionsController < ApplicationController
  def new
    # offending line
    @user_session = UserSession.new
  end
end

# error message
ActionView::Template::Error (undefined method `to_key' for #) on line #2 of /Users/leonard/Sites/media_six/single_sign_on/app/views/user_sessions/new.html.erb:
1: 
2: <%= form_for @user_session do |f| %>
3:  <%= render "shared/error_messages", :target => @user_session %>
4:  
5:  <%= field_set_tag 'login' do %>

from authlogic.

wsc avatar wsc commented on May 27, 2024

coop: me too, on my r3b3 test project.

from authlogic.

plukevdh avatar plukevdh commented on May 27, 2024

same here

from authlogic.

 avatar commented on May 27, 2024

I had problems when I tried to do it without a user id / login field. I wanted multiple email addresses associated with a single account/password, and authlogic does not support that. Make sure you have some sort of login field.

from authlogic.

globesofttech avatar globesofttech commented on May 27, 2024

is any one find the solution? i am facing the same...

from authlogic.

plusjade avatar plusjade commented on May 27, 2024

I managed to get mine working by changing form_for tag to this:

<% form_for :user_session, @user_session, :url => { :action => "create" } do |f| %>

Hope this helps.

from authlogic.

evan2m avatar evan2m commented on May 27, 2024

@plusjade

Thanks, that is what is needed to display default form errors on the login template.

To keep the form from repopulating the login field. I added the following to UserSessionsController::create
@user_session.login = nil
render :action => :new

from authlogic.

jaredbeck avatar jaredbeck commented on May 27, 2024

Closing after six years with no activity. If this is still a problem in the latest version (currently 3.5.0), please let us know and we'll be happy to re-open the issue.

from authlogic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.