resetPassword() public method

Reset a given user password
Author: Steve Montambeault
public resetPassword ( $code, $password ) : Cartalyst\Sentry\Users\UserInterface
$code
$password
return Cartalyst\Sentry\Users\UserInterface
示例#1
0
 /**
  * Reset a given user password
  *
  * @author Steve Montambeault
  * @link   http://stevemo.ca
  *
  * @param array $creds
  *
  * @return bool
  */
 public function reset(array $creds)
 {
     try {
         if ($this->validator->with($creds)->passes()) {
             $this->users->resetPassword($creds['code'], $creds['password']);
             return true;
         }
     } catch (UserNotFoundException $e) {
         $this->validator->add('UserNotFoundException', $e->getMessage());
     }
     return false;
 }