userRepo = $userRepo; } public function loadUserByUsername($username): User { if (null === $user = $this->userRepo->findUserByTokenKey($username)) { throw new UsernameNotFoundException(sprintf('Token \'%s\' is not found.', $username)); } return $user; } public function refreshUser(UserInterface $user) { throw new UnsupportedUserException(); } public function supportsClass($class): bool { return User::class === $class; } }