Ejemplo n.º 1
0
 public function testInvalidateTokens()
 {
     $token = $this->service->generateToken($this->user, 'action');
     $this->service->invalidateTokens($this->user, 'action');
     $this->assertFalse($this->service->checkToken($this->user, $token, 'action'));
 }
Ejemplo n.º 2
0
 /**
  * Send password restore token
  *
  * @param Newscoop\Entity\User $user
  * @return void
  */
 public function sendPasswordRestoreToken(User $user)
 {
     $message = $this->view->action('password-restore', 'email', 'default', array('user' => $user->getId(), 'token' => $this->tokenService->generateToken($user, 'password.restore'), 'format' => null));
     $this->send($this->view->placeholder(self::PLACEHOLDER_SUBJECT), $message, $user->getEmail());
 }