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