From 423ad7b2c966ce23ecf6f5c826f56b27f42ab8bd Mon Sep 17 00:00:00 2001 From: AnimeDL Date: Sat, 27 Jul 2024 08:31:24 -0700 Subject: [PATCH] [ADN] Fix refresh token request --- adn.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/adn.ts b/adn.ts index 9292c0d..1d98bcf 100644 --- a/adn.ts +++ b/adn.ts @@ -216,19 +216,16 @@ export default class AnimationDigitalNetwork implements ServiceClass { method: 'POST', headers: { Authorization: `Bearer ${this.token.accessToken}`, - 'Cookie': `adnrt=${this.token.refreshToken}`, - 'X-Access-Token': this.token.accessToken + 'X-Access-Token': this.token.accessToken, + 'content-type': 'application/json' }, - body: '{}' + body: JSON.stringify({refreshToken: this.token.refreshToken}) }); if(!authReq.ok || !authReq.res){ console.error('Token refresh failed!'); return { isOk: false, reason: new Error('Token refresh failed') }; } this.token = await authReq.res.json(); - const cookies = this.parseCookies(authReq.res.headers.get('Set-Cookie')); - //this.token.refreshtoken = this.token.refreshToken; - this.token.refreshToken = cookies.adnrt; yamlCfg.saveADNToken(this.token); return { isOk: true, value: undefined }; }