Skip to content

Instantly share code, notes, and snippets.

@edderrd
Last active August 29, 2015 13:59
Show Gist options
  • Save edderrd/10610921 to your computer and use it in GitHub Desktop.
Save edderrd/10610921 to your computer and use it in GitHub Desktop.
Zizaco/Confide Reset password workarround
<?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