lgao
April 12, 2006, 7:20am
1
Hi,
I searched “UserEngine Infinite Loop” thread and it didn’t solve my
problem.
I installed LoginEngine only, and everytime I try to login, it will
redirect to /user/login.
Here is rail’s developement log:
Processing UserController#login (for 127.0.0.1 at 2006-04-12 09:22:28)
[POST]
Session ID: 6f7af19de1b302fc18ebfd95293d3d40
Parameters: {“user”=>{“login”=>“liang”, “password”=>“”},
“commit”=>“Login”, “action”=>“login”, “controller”=>“user”}
e[4;36;1mUser Columns (0.010000)e[0m e[0;1mSHOW FIELDS FROM
userse[0m
e[4;35;1mUser Load (0.010000)e[0m e[0mSELECT * FROM users WHERE
(login = ‘liang’ AND verified = 1 AND deleted = 0) LIMIT 1e[0m
Rendering user/login
Completed in 0.02000 (50 reqs/sec) | Rendering: 0.00000 (0%) | DB:
0.02000 (100%) | 200 OK [http://localhost/user/login ]
I can create user via “register for an account” and I saw it in mysql
database, but after creat the user, it will redirect to /user/login as
well.
I think I carefully followed http://api.rails-engines.org/login_engine/
to install but I am really new to Rails…
thx
lgao
April 12, 2006, 10:31am
2
Hi,
After you create a user you will be redirected to /user/login.
It will require you to actually login.
You don’t look like you’re actually providing a password when you try to
login.
Regards,
Jon
On 12/04/06, liang gao [email protected] wrote:
[POST]
Posted via http://www.ruby-forum.com/ .
engine-users mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org
–
lgao
April 12, 2006, 10:56am
3
hi,Jim.
actually I tried with valid username/password and I still being redirect
back to /user/login.
lgao
April 12, 2006, 11:05am
4
Hi,
I cannot recreate the problem. However, looking at the log messages in
your first message, your password is empty. Check your flash messages
for errors.
Regards,
Jon
On 12/04/06, liang gao [email protected] wrote:
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org
–
lgao
April 14, 2006, 5:07am
5
Now I know what the problem is.
I always get an “loging unsuccessful” even I use the right
username/password.
I did some debug to see what went wrong, the “login” in UserController
will always return with “nil” and that is why.
I added an “raise” in
/vendor/plugin/login_engine/lib/login_engine/authenticated_user.rb
def authenticate(login, pass)
raise "login is #{login} , and pass is #{pass}"
u = find(:first, :conditions => ["login = ? AND verified = 1 AND
deleted = 0", login])
return nil if u.nil?
find(:first, :conditions => [“login = ? AND salted_password = ?
AND verified = 1”, login, AuthenticatedUser.salted_password(u.salt,
AuthenticatedUser.hashed(pass))])
end
But I never see the raise is being called. How should I debug this
problem?