mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-01 21:13:39 +01:00
Fix: other jsonrpc widgets broken in 0.9.8 (#3976)
This commit is contained in:
parent
52a4f1a423
commit
6b1080ad43
@ -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…
x
Reference in New Issue
Block a user