[HD]: Fix Token Refresh
Some checks failed
auto-documentation / documentation (push) Has been cancelled
build and push docker image / build-node (push) Has been cancelled
Style and build test / eslint (push) Has been cancelled
Style and build test / test (push) Has been cancelled

This commit is contained in:
AnimeDL 2025-08-09 10:37:33 -07:00
parent e3b7bd3df3
commit 959518499b

View file

@ -151,7 +151,7 @@ export default class Hidive implements ServiceClass {
};
let apiReq = await this.req.getData(options.url, apiReqOpts);
if(!apiReq.ok || !apiReq.res){
if (apiReq.error && apiReq.error.res?.status == 401) {
if ((apiReq.error && apiReq.error.res?.status == 401) || (apiReq.res && apiReq.res.status == 401)) {
console.warn('Token expired, refreshing token and retrying.');
if (await this.refreshToken()) {
if (authType == 'other') {