Fix: other jsonrpc widgets broken in 0.9.8 (#3976)

pull/3987/head v0.9.9
shamoon 2 months ago committed by GitHub
parent 52a4f1a423
commit 6b1080ad43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -14,11 +14,11 @@ export async function sendJsonRpcRequest(url, method, params, widget) {
accept: "application/json",
};
if (widget.username && widget.password) {
if (widget?.username && widget?.password) {
headers.Authorization = `Basic ${Buffer.from(`${widget.username}:${widget.password}`).toString("base64")}`;
}
if (widget.key) {
if (widget?.key) {
headers.Authorization = `Bearer ${widget.key}`;
}

Loading…
Cancel
Save