src/Module/Authentication/LocalAuth/LocalAuth.php
protected function passwordRehash($username, Password $password)
    {
        $userData = $this->storage->getUserByName($username);
        
        try {
            $this->userDataEncodePassword($userData, $password);
        } catch (\PicoAuth\Security\Password\Encoder\EncoderException $e) {
            // The encoder was changed to one that is not able to store this password
            $this->session->addFlash("error", "Please set a new password.");
            $this->picoAuth->getContainer()->get('PasswordReset')->startPasswordResetSession($username);
            $this->picoAuth->redirectToPage("password_reset");
        }
        
        $this->storage->saveUser($username, $userData);
    }
protected function passwordRehash($username, Password $password)
    {
        $userData = $this->storage->getUserByName($username);
        
        try {
            $this->userDataEncodePassword($userData, $password);
        } catch (\PicoAuth\Security\Password\Encoder\EncoderException $e) {
            // The encoder was changed to one that is not able to store this password
            $this->session->addFlash("error", "Please set a new password.");
            $this->picoAuth->getContainer()->get('PasswordReset')->startPasswordResetSession($username);
            $this->picoAuth->redirectToPage("password_reset");
        }
        
        $this->storage->saveUser($username, $userData);
    }
protected function passwordRehash ( $ username , Password $ password ) { $ userData = $ this -> storage -> getUserByName ( $ username ) ; try { $ this -> userDataEncodePassword ( $ userData , $ password ) ; } catch ( \ PicoAuth \ Security \ Password \ Encoder \ EncoderException $ e ) { // The encoder was changed to one that is not able to store this password $ this -> session -> addFlash ( "error" , "Please set a new password." ) ; $ this -> picoAuth -> getContainer ( ) -> get ( 'PasswordReset' ) -> startPasswordResetSession ( $ username ) ; $ this -> picoAuth -> redirectToPage ( "password_reset" ) ; } $ this -> storage -> saveUser ( $ username , $ userData ) ; }
Performs a password rehash

@param string $username User identifier
@param Password $password The password to be resaved
Performs a password rehash