dparlevliet / node.bittrex.api

Node Bittrex API is an asynchronous node.js library for the Bittrex API, the data can be received either via GET request or Stream.
MIT License
253 stars 100 forks source link

Bittrex.Options updating keys? #124

Closed springjben closed 6 years ago

springjben commented 6 years ago

I have a Express server and it's using sessions to store a person's key information.

However, when 2 people visit the website their web sockets merge and the last person to visit the site can view all their API information.

How do I make it so that when someone logs their account on my website their Bittrex.options api keys are unique to them and the server doesn't allow others to view their stuff.

E.g.

User A visits and logs into site (my node server sets up Bittrex.options to their API info) User B visits and logs into site (my node server also tries to set the Bittrex options for the web sockets) Now user A can see User B's stuff as it's updating the web sockets stuff.

TL:DR - When I update 1 persons bittrex.options(api) information, it updates for everyone using the site. How do I stop this?

springjben commented 6 years ago

Do I have to simply to bittrex.options(api... ) before every call? What about the web socket stuff?

springjben commented 6 years ago

Yeah, do I need to use express sessions with Socket.io?

If I update bittrex.options(api..) information for 1 person, it updates it for all people who are using the site. I want there to be independent connections. I almost need everyone who connects to the website to have an independent Bittrex variable so it unique to the user.

Almost with there was a way to stop it updating one web sockets information once its been set.

springjben commented 6 years ago

Is it best I just make calls not using the web sockets? So I just use web sockets for all of the public stuff and then the private calls I do separately?

springjben commented 6 years ago

https://github.com/dparlevliet/node.bittrex.api/issues/86

^ Thats basically my question