Last active
August 29, 2015 13:59
-
-
Save edderrd/10610921 to your computer and use it in GitHub Desktop.
Zizaco/Confide Reset password workarround
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class User extends ConfideUser { | |
/** | |
* Change user password | |
* | |
* @param $params | |
* @return string | |
*/ | |
public function resetPassword( $params ) | |
{ | |
//$password = array_get($params, 'password', ''); | |
$this->password = array_get($params, 'password', ''); | |
$this->password_confirmation = array_get($params, 'password_confirmation', ''); | |
$passwordValidators = array( | |
'password' => static::$rules['password'], | |
'password_confirmation' => static::$rules['password_confirmation'], | |
); | |
//$validationResult = static::$app['confide.repository']->validate($passwordValidators); | |
$validationResult = $this->validate($passwordValidators); | |
if ( $validationResult ) | |
{ | |
return static::$app['confide.repository'] | |
//->changePassword( $this, static::$app['hash']->make($password) ); | |
->changePassword( $this, static::$app['hash']->make($this->password) ); | |
} | |
else{ | |
return false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment