We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cdfe8d7 commit 3404b87Copy full SHA for 3404b87
src/miscRequests.js
@@ -428,10 +428,11 @@ module.exports = {
428
* @returns {Promise<User>} Token
429
*/
430
async getUser(session, signature = '', location = 'https://www.tradingview.com/') {
431
- const { data } = await axios.get(location, {
+ const { data, headers } = await axios.get(location, {
432
headers: {
433
cookie: genAuthCookies(session, signature),
434
},
435
+ maxRedirects: 0,
436
validateStatus,
437
});
438
@@ -457,6 +458,10 @@ module.exports = {
457
458
};
459
}
460
461
+ if (headers.location !== location) {
462
+ return this.getUser(session, signature, headers.location);
463
+ }
464
+
465
throw new Error('Wrong or expired sessionid/signature');
466
467
0 commit comments