public function getUser($token)
    {
        $payload = $this->getPayload($token);

        if (empty($payload[JWSTokenService::USER_ID_KEY])) {
            throw new ProgrammerException("No user_id in token payload", ProgrammerException::AUTH_TOKEN_NO_USER_ID);
        }

        $userId = $payload[JWSTokenService::USER_ID_KEY];

        $user =  $this->userService->findUserById($userId);

        if (empty($user)) {
            throw new ProgrammerException(
                "Unknown user id in token, " . $userId,
                ProgrammerException::AUTH_TOKEN_NO_USER_WITH_ID_FOUND
            );
        }

        return $user;
    }
public function getUser($token)
    {
        $payload = $this->getPayload($token);

        if (empty($payload[JWSTokenService::USER_ID_KEY])) {
            throw new ProgrammerException("No user_id in token payload", ProgrammerException::AUTH_TOKEN_NO_USER_ID);
        }

        $userId = $payload[JWSTokenService::USER_ID_KEY];

        $user =  $this->userService->findUserById($userId);

        if (empty($user)) {
            throw new ProgrammerException(
                "Unknown user id in token, " . $userId,
                ProgrammerException::AUTH_TOKEN_NO_USER_WITH_ID_FOUND
            );
        }

        return $user;
    }
public function getUser ( $ token ) { $ payload = $ this -> getPayload ( $ token ) ; if ( empty ( $ payload [ JWSTokenService :: USER_ID_KEY ] ) ) { throw new ProgrammerException ( "No user_id in token payload" , ProgrammerException :: AUTH_TOKEN_NO_USER_ID ) ; } $ userId = $ payload [ JWSTokenService :: USER_ID_KEY ] ; $ user = $ this -> userService -> findUserById ( $ userId ) ; if ( empty ( $ user ) ) { throw new ProgrammerException ( "Unknown user id in token, " . $ userId , ProgrammerException :: AUTH_TOKEN_NO_USER_WITH_ID_FOUND ) ; } return $ user ; }
Returns the user attached to the token

@param string $token

@return BaseUser
@throws ProgrammerException
Returns the user attached to the token