Stevemo\Cpanel\User\Repo\UserRepository::resetPassword PHP Метод

resetPassword() публичный Метод

Reset a given user password
Автор: Steve Montambeault
public resetPassword ( $code, $password ) : Cartalyst\Sentry\Users\UserInterface
$code
$password
Результат Cartalyst\Sentry\Users\UserInterface
    public function resetPassword($code, $password)
    {
        try {
            $user = $this->sentry->findUserByResetPasswordCode($code);
            $user->password = $password;
            $user->save();
            $this->event->fire('users.password.reset', array($user));
            return $user;
        } catch (SentryUserNotFoundException $e) {
            throw new UserNotFoundException($e->getMessage());
        }
    }