Forum: Rails Engines LoginEngine Infinite Loop Problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5b8e28dfc732a50566c077f212871ff6?d=identicon&s=25 Liang Gao (lgao)
on 2006-04-12 07:20
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"}
  User Columns (0.010000)   SHOW FIELDS FROM
users
  User Load (0.010000)   SELECT * FROM users WHERE
(login = 'liang' AND verified = 1 AND deleted = 0) LIMIT 1
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
78d45b303250a077fc65fd61e00277ed?d=identicon&s=25 Jon Lim (Guest)
on 2006-04-12 10:31
(Received via mailing list)
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 <liangg@gmail.com> wrote:
> [POST]
>
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> engine-users mailing list
> engine-users@lists.rails-engines.org
> http://lists.rails-engines.org/listinfo.cgi/engine...
>


--
http://www.snowblink.co.uk/
5b8e28dfc732a50566c077f212871ff6?d=identicon&s=25 Liang Gao (lgao)
on 2006-04-12 10:56
hi,Jim.

actually I tried with valid username/password and I still being redirect
back to /user/login.
78d45b303250a077fc65fd61e00277ed?d=identicon&s=25 Jon Lim (Guest)
on 2006-04-12 11:05
(Received via mailing list)
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 <liangg@gmail.com> wrote:
> http://lists.rails-engines.org/listinfo.cgi/engine...
>


--
http://www.snowblink.co.uk/
5b8e28dfc732a50566c077f212871ff6?d=identicon&s=25 Liang Gao (lgao)
on 2006-04-14 05:07
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?
This topic is locked and can not be replied to.