Skip to content

Commit

Permalink
add methods to create, delete, and validate password reset tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
browner12 committed Apr 6, 2016
1 parent f004a43 commit bea5690
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/Illuminate/Auth/Passwords/PasswordBroker.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,37 @@ public function getRepository()
{
return $this->tokens;
}

/**
* Generate a password reset token.
*
* @param CanResetPasswordContract $user
* @return string
*/
public function generateToken(CanResetPasswordContract $user)
{
return $this->tokens->create($user);
}

/**
* Delete password reset token.
*
* @param string $token
*/
public function deleteToken($token)
{
$this->tokens->delete($token);
}

/**
* Validate password reset token.
*
* @param CanResetPasswordContract $user
* @param string $token
* @return bool
*/
public function validateToken(CanResetPasswordContract $user, $token)
{
return $this->tokens->exists($user, $token);
}
}

0 comments on commit bea5690

Please sign in to comment.