mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-08 14:38:47 +00:00
Fix: other jsonrpc widgets broken in 0.9.8 (#3976)
This commit is contained in:
parent
52a4f1a423
commit
6b1080ad43
1 changed files with 2 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue