userRepository->getFirstWhere('email', $email); if (!$user || !$this->hash->check($password, $user->password)) { throw new InvalidCredentialsException(); } if ($this->hash->needsRehash($user->password)) { $user->password = $this->hash->make($password); $user->save(); } return $this->tokenManager->createCompositeToken($user); } public function logoutViaBearerToken(string $token): void { $this->tokenManager->deleteCompositionToken($token); } }