Enhancement: support ESPHome widget authentication (#3846)
* Added cookie support for auth on ESPHome widget * Lint * Use credentialedProxyHandler instead --------- Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
1 parent
9ede44b12d
commit
2ee14eb94b
3 files changed
+7
-2
No files matched your search
@@ -84,6 +84,10 @@ export default async function credentialedProxyHandler(req, res, map) {
|
||||
headers.Key = `${widget.key}`;
|
||||
} else if (widget.type === "myspeed") {
|
||||
headers.Password = `${widget.password}`;
|
||||
} else if (widget.type === "esphome") {
|
||||
if (widget.key) {
|
||||
headers.Cookie = `authenticated=${widget.key}`;
|
||||
}
|
||||
} else {
|
||||
headers["X-API-Key"] = `${widget.key}`;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user