Comments (11)
You should do something like that:
@account_session = AccountSession.new(:username => 'my_username', :password => 'password')
from authlogic.
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.
Did you ever figure this out? I'm having a very similar problem.
from authlogic.
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.
coop: me too, on my r3b3 test project.
from authlogic.
same here
from authlogic.
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.
is any one find the solution? i am facing the same...
from authlogic.
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.
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.
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)
- Resetting passwords on Authlogic > 5 with default config allows blank passwords HOT 4
- act_like_restful_authentication for v5 HOT 2
- Hashing ascii values vs bytes with SHA512 HOT 3
- Support for SameSite: "None" cookies HOT 1
- No changelog for 6.1.0 HOT 4
- Ruby 2.7 warnings HOT 2
- Inconsistent credentials cookie behaviour HOT 6
- Password#password_changed? returns true when transitioning crypto providers HOT 4
- Raise an error if database connection is not established before using acts_as_authentic
- Thread Safety HOT 1
- Ruby 2.7 warnings even in 6.1.0 (but not in master) HOT 2
- There isn't Git tag for v5.2.0. HOT 1
- Rubydoc for Authlogic is broken HOT 1
- When logging out from inside an iframe the `user_credentials` cookie doesn't get deleted in chromium based browsers. HOT 1
- Upgrade dependencies to accept Rails 7 HOT 10
- Eliminating a deprecation warning in Rails 7.0 HOT 3
- Wrong error message when valid email format of not existing user and fake password provided HOT 1
- NameError - wrong constant name Object.const_get(camel_cased_word) HOT 1
- Reference documentation (rubydoc) is broken
- NameError: `@' is not allowed as an instance variable name HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from authlogic.