Exemplo n.º 1
0
 /**
  * Handle
  * @param User $user
  */
 public function handle(User $user)
 {
     // Set last attempt timestamp
     $user->setLastLoginAt(new LastLoginAt());
     $this->repository->persist($user);
     $this->repository->flush();
 }
Exemplo n.º 2
0
 /**
  * Handle
  * @param Event $event
  */
 public function handle($event)
 {
     $user = $this->repository->findByEmail(new Email($event['email']));
     if ($user) {
         // Set last attempt timestamp
         $user->setLastAttemptAt(new LastAttemptAt());
         $this->repository->persist($user);
         $this->repository->flush();
     }
 }
Exemplo n.º 3
0
 /**
  * Handle
  * @param User $user
  */
 public function handle(User $user)
 {
     if ($user && $user->isSuspended()) {
         $this->guard->logout();
         throw new UserIsSuspendedException('You are temporarily suspended. Try again later.');
     } elseif ($user && $user->getSuspendedTill()) {
         $user->unsetSuspended();
         $this->repository->persist($user);
         $this->repository->flush();
     }
 }
Exemplo n.º 4
0
 /**
  * Find a user by its credentials
  * @param  array $credentials
  * @return mixed
  */
 public function findByCredentials(array $credentials)
 {
     return $this->user->findByCredentials($credentials);
 }
Exemplo n.º 5
0
 /**
  * Retrieve a user by the given credentials.
  * @param  array $credentials
  * @return Authenticatable|null
  */
 public function retrieveByCredentials(array $credentials)
 {
     return $this->repository->findByCredentials($credentials);
 }