add support for using an API key with Kavita
This commit is contained in:
parent
cd8c224ffa
commit
710b79fdc8
@ -15,4 +15,5 @@ widget:
|
|||||||
url: http://kavita.host.or.ip:port
|
url: http://kavita.host.or.ip:port
|
||||||
username: username
|
username: username
|
||||||
password: password
|
password: password
|
||||||
|
apiKey: apikeyapikeyapikeyapikeyapikey
|
||||||
```
|
```
|
||||||
|
|||||||
@ -14,7 +14,7 @@ async function login(widget, service) {
|
|||||||
const endpoint = "Account/login";
|
const endpoint = "Account/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 || "", password: widget.password || "", apiKey: widget.apiKey || "" };
|
||||||
const headers = { "Content-Type": "application/json", accept: "text/plain" };
|
const headers = { "Content-Type": "application/json", accept: "text/plain" };
|
||||||
|
|
||||||
const [, , data] = await httpProxy(loginUrl, {
|
const [, , data] = await httpProxy(loginUrl, {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user