Dispatch password recover event.

@param AbstractUserInterface $user User

@return $this Self object
490798
public function dispatchOnPasswordRecoverEvent(AbstractUserInterface $user)
    {
        $event = new PasswordRecoverEvent($user);
        $this
            ->eventDispatcher
            ->dispatch(
                ElcodiUserEvents::PASSWORD_RECOVER,
                $event
            );
    }
1315132
private function encodePassword(UserInterface $user, $password, $salt)
    {
        $encoder = $this->get('sulu_security.encoder_factory')->getEncoder($user);

        return $encoder->encodePassword($password, $salt);
    }
326669
protected function resetPassword($user, $password)
    {
        $user->password = (new Hasher())->make($password);

        Person::save($user);
        auth()->login($user);
    }
1221786
protected function resolveUser($user)
    {
        if ($user instanceof UserInterface) {
            return $user;
        }

        if (is_integer($user)) {
            $user = $this->sentinel->findById($user);
        } else {
            $user = $this->sentinel->findByCredentials([
                'email' => $user
            ]);
        }

        return $user ?: false;
    }
420129
public function removeUser($user)
    {
        $username = ($user instanceof UserInformation) ? $user->getUsername() : (string) $user;

        $this->configSource->set('auth-password/' . $username, null);

        return $this;
    }
187806
public function register(AbstractUserInterface $user)
    {
        parent::register($user);

        /**
         * @var CustomerInterface $user
         */
        $this
            ->userEventDispatcher
            ->dispatchOnCustomerRegisteredEvent($user);

        return $this;
    }
92084
private function validateUser(UserInterface $user)
    {
        return $user->isValid($this->username, $this->password, $this->realm);
    }
264005
public function forgotPassword( $user ) {

		$modelClass	= static::$modelClass;

		// Find existing user
		$userToUpdate = $modelClass::findById( $user->id );

		// Generate Token
		$userToUpdate->generateResetToken();
		$userToUpdate->generateOtp();

		// Update User
		$userToUpdate->update();

		return $userToUpdate;
	}
855934
public function setUser(UserInterface $user)
    {
        parent::setUser($user);

        //Store the user by email
        if($email = $user->getEmail()) {
            $this->_emails[$email] = $user;
        }

        return $this;
    }
1221073
public function authenticate(GenericUserInterface $user, $credential)
    {
        $userAttributes = $user->getAttributes();
        if (empty($userAttributes)) {
            throw new IdentityNotFoundException();
        }
        $this->store($user->getAttributes());

        return true;
    }
928899
protected function createRememberTokenIfDoesntExist(UserInterface $user)
    {
        $rememberToken = $user->getRememberToken();

        if (empty($rememberToken)) {
            $this->refreshRememberToken($user);
        }
    }
1332848
protected function resetPassword($user, $password)
    {
        $user->forceFill([
            'password' => bcrypt($password),
            'remember_token' => Str::random(60),
        ])->save();

        $this->guard()->login($user);
    }
725868
protected function save(UserInterface $user)
    {
        try
        {
            $entityManager = $this->getEntityManager();
            $entityManager->persist($user);
            $entityManager->flush();

            return $user;
        }
        catch (\Exception $e)
        {
            return false;
        }
    }
1221239
protected function gatherPermissions(UserInterface $user = null)
    {
        $user = $user ?: $this->currentUser();
        $roles = $user->getRoles();
        $permissions = $user->getPermissions();

        foreach ($roles as $role) {
            if (isset($this->roleDictionary[$role])) {
                $permissions = array_merge($permissions, $this->roleDictionary[$role]);
            }
        }

        return $permissions;
    }
489073
private function findKeyByUser(PKEncryptionEnabledUserInterface $user)
    {
        $userClass = $this->getUserClass($user);
        $userId = $user->getId();
        $key = $this->getKeyRepository()->findOneBy(array('userClass' => $userClass, 'userId' => $userId));

        return $key;
    }
11570
public function restore_key( $user ) 
	{
		return \CCStr::hash( $user->password.'@'.$user->{$this->config->user_key}.'%'.\CCIn::client()->agent );
	}
1267743
public function logUser(\Symfony\Component\Security\Core\User\UserInterface $user)
    {
        // Here, "main" is the name of the firewall in your security.yaml
        $token = new UsernamePasswordToken($user, null, 'main', $user->getRoles());
        $this->get('security.token_storage')->setToken($token);

        // Fire the login event
        $this->get('event_dispatcher')->dispatch(AuthenticationEvents::AUTHENTICATION_SUCCESS, new AuthenticationEvent($token));
    }