public static function getPayload($token, $jsonDecode = true)
    {
        // Split parts
        list($payload, $signature) = explode('.', $token);

        // Decode first part
        $payloadJSON = base64_decode($payload);

        // Choose to decode or not
        if ($jsonDecode) {
            return json_decode($payloadJSON, true);
        }

        // Return json
        return $payloadJSON;
    }