Skip to content

Commit 4b7f288

Browse files
Fix for bug#259
**Root cause** The client constructor relies on the `getUser` method of the `miscRequests` module, which requires location-specific URL to be passed as one of its arguments. Added a property `location` to the `clientOptions` object passed to the client constructor. This `location` field will then be passed to the `getUser` method within the constructor.
1 parent 6cc1a40 commit 4b7f288

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/client.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ module.exports = class Client {
217217
* @prop {string} [signature] User auth token signature (in 'sessionid_sign' cookie)
218218
* @prop {boolean} [DEBUG] Enable debug mode
219219
* @prop {'data' | 'prodata' | 'widgetdata'} [server] Server type
220+
* @prop {string} [location] Auth page location (For france: https://fr.tradingview.com/)
220221
*/
221222

222223
/** Client object
@@ -234,6 +235,7 @@ module.exports = class Client {
234235
misc.getUser(
235236
clientOptions.token,
236237
clientOptions.signature ? clientOptions.signature : '',
238+
clientOptions.location ? clientOptions.location : "https://tradingview.com",
237239
).then((user) => {
238240
this.#sendQueue.unshift(protocol.formatWSPacket({
239241
m: 'set_auth_token',

0 commit comments

Comments
 (0)