mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-15 01:10:35 +00:00
Enhancement: support basic auth to ESPHome widget (#4429)
This commit is contained in:
parent
b853c566b2
commit
6b2a3da7ee
2 changed files with 5 additions and 2 deletions
|
@ -89,7 +89,9 @@ export default async function credentialedProxyHandler(req, res, map) {
|
|||
} else if (widget.type === "myspeed") {
|
||||
headers.Password = `${widget.password}`;
|
||||
} else if (widget.type === "esphome") {
|
||||
if (widget.key) {
|
||||
if (widget.username && widget.password) {
|
||||
headers.Authorization = `Basic ${Buffer.from(`${widget.username}:${widget.password}`).toString("base64")}`;
|
||||
} else if (widget.key) {
|
||||
headers.Cookie = `authenticated=${widget.key}`;
|
||||
}
|
||||
} else if (widget.type === "wgeasy") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue