mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-01 21:13:39 +01:00
Update proxy.js
This commit is contained in:
parent
d0eabf7adb
commit
6b77ae835b
@ -54,7 +54,7 @@ export default async function beszelProxyHandler(req, res) {
|
||||
if (!token) {
|
||||
[status, token] = await login(loginUrl, widget.username, widget.password, service);
|
||||
if (status !== 200) {
|
||||
logger.debug(`HTTP ${status} logging into npm api: ${token}`);
|
||||
logger.debug(`HTTP ${status} logging into Beszel: ${token}`);
|
||||
return res.status(status).send(token);
|
||||
}
|
||||
}
|
||||
@ -68,12 +68,12 @@ export default async function beszelProxyHandler(req, res) {
|
||||
});
|
||||
|
||||
if (status === 403) {
|
||||
logger.debug(`HTTP ${status} retrieving data from npm api, logging in and trying again.`);
|
||||
logger.debug(`HTTP ${status} retrieving data from Beszel, logging in and trying again.`);
|
||||
cache.del(`${tokenCacheKey}.${service}`);
|
||||
[status, token] = await login(loginUrl, widget.username, widget.password, service);
|
||||
|
||||
if (status !== 200) {
|
||||
logger.debug(`HTTP ${status} logging into npm api: ${data}`);
|
||||
logger.debug(`HTTP ${status} logging into Beszel: ${data}`);
|
||||
return res.status(status).send(data);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user