Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Auth change password
  • Hello,

    I want to change the user's password. For this, I use the function

    Auth::change_password($old_password, $new_password, $username);

    But it works with all values in "old_password".

    I don't understand why..
  • What type of Auth? Which Fuel version?
  • I'm using Simpleauth with the version 1.7.2 of Fuel
  • I can't immediately see how that would happen.

    Could you create an issue for this at https://github.com/fuel/auth/issues ?
  • Before that, maybe I've not configured or used good the auth package, no ?

    I've added "auth" in my config.php file in "always_load" section

    I've created a "auth.php" config file with 
    ...
    'driver' => 'Simpleauth',
    ...

    And a simpleauth.php config file with my groups and my roles

    And then I use the auth functions to perform all actions I need, included the change of user's password.

    Something missing ?
  • One precision after some tests :

    The password is changed only when the old_password is correct but I haven't got any error when I enter a wrong old password.
  • I've found the problem ...

    Here my code :

    try
    {
        Auth::change_password(
            $old_password,
            $new_password,
            $user->username
        );
        Response::redirect('user');
    }
    catch (Exception $e)
    {
        Session::set_flash('error', $e->getMessage());
    }


    But the change_password() function return a Boolean and not an Exception...

    Sorry and thank you for your help :)

Howdy, Stranger!

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

In this Discussion