public static function verifyUser($payload)
    {
        $userId = $payload->get('user_id');
        $userKey = $payload->get('sub');
        $userInfo = ($userId) ? User::getCachedInfo($userId) : null;

        if (!empty($userInfo) && $userKey === md5($userInfo['email'])) {
            return true;
        } else {
            throw new TokenInvalidException('User verification failed.');
        }
    }