Fix: homebridge widget with numeric username or password (#3220)

This commit is contained in:
Luca Herrero 2024-04-01 23:17:56 +02:00 committed by GitHub
parent 0d7b77260f
commit 2ebcb311e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,7 +14,7 @@ async function login(widget, service) {
const endpoint = "auth/login"; const endpoint = "auth/login";
const api = widgets?.[widget.type]?.api; const api = widgets?.[widget.type]?.api;
const loginUrl = new URL(formatApiCall(api, { endpoint, ...widget })); const loginUrl = new URL(formatApiCall(api, { endpoint, ...widget }));
const loginBody = { username: widget.username, password: widget.password }; const loginBody = { username: widget.username.toString(), password: widget.password.toString() };
const headers = { "Content-Type": "application/json" }; const headers = { "Content-Type": "application/json" };
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
const [status, contentType, data, responseHeaders] = await httpProxy(loginUrl, { const [status, contentType, data, responseHeaders] = await httpProxy(loginUrl, {