mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-09 23:08:48 +00:00
Add support of NC-Token to Nextcloud widget
This commit is contained in:
parent
b488d6a13c
commit
94dc5ad0e5
2 changed files with 11 additions and 3 deletions
|
@ -48,6 +48,14 @@ export default async function credentialedProxyHandler(req, res, map) {
|
|||
headers.Authorization = `Token ${widget.key}`;
|
||||
} else if (widget.type === "miniflux") {
|
||||
headers["X-Auth-Token"] = `${widget.key}`;
|
||||
} else if (widget.type === "nextcloud") {
|
||||
if ('key' in widget) {
|
||||
logger.debug("Setting nextcloud to use NC-Token");
|
||||
headers["NC-Token"] = `${widget.key}`;
|
||||
} else {
|
||||
logger.debug("Setting nextcloud to use username", widget.username);
|
||||
headers.Authorization = `Basic ${Buffer.from(`${widget.username}:${widget.password}`).toString("base64")}`;
|
||||
}
|
||||
} else {
|
||||
headers["X-API-Key"] = `${widget.key}`;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue