Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Orm Auth issue
  • After running the composer update, auth login is running this query during login:
    UPDATE `users` SET` username` = 0, `group_id` = null,` password` = 0, `last_login` = 1505861371,` previous_login` = null, `login_hash` = '65542f800f5214017e41e4f4fdae6011321d566b',` user_id` = 1, `` created_at` = 0, `updated_at` = 1505861371 WHERE` id` = '1

    Can anybody help me ?

  • pompexpompex
    Accepted Answer
    How are you logging in? Docs are pretty clear regarding this. Can you be more specific on what are you trying to do? 
  • I ran composer update to update the core of the fuel. After the update, when I tried to login on the system I have here, the user I had (admin / admin) was updated and entered 0 in the name and password columns.
  • There isn't anything in the Fuel code that would update data.

    Migration 005 of the Auth package will create an admin and guest account if they don't exist, but that code does not contain an update query, nor something that would update the username.

    An Auth login does call $this->user->save(), to update the login hash, last login and previous login. So perhaps you have something in your code that accesses the Auth's user object, and causes the username, password and group to be reset?

    Direct access should not be possible, $user is a protected property.

    This happens in create_login_hash(), perhaps to debug  the issue dump $this->user->get_diff() to see what is changed prior to the call to save()?
  • I just ran the composer update. I did not perform migrations. I tried logging in to the system after the composer update, and realized that an update querey had been executed instead of a select by the user
  • HarroHarro
    Accepted Answer
    If you can reproduce it, you can enable the profiler. It will show you a code backtrace of where the query originated. 

    I can't imagine anything in the framework causing this, all our apps use Ormauth, and all always run on the latest develop (we eat our own dogfood ;-)). I'd say we would have noticed this by now.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion