DoctorMcKay / node-steam-session

Node.js module for authenticating with the Steam auth server. Allows for generating refresh tokens and web auth cookies for use with steam-user and other packages.
https://www.npmjs.com/package/steam-session
MIT License
112 stars 20 forks source link

Add platform type validation for refresh token #25

Closed Sadzurami closed 1 year ago

Sadzurami commented 1 year ago

Now we don't validate this part of refresh token. That may have issues.

For example, if user accidentally pass EAuthTokenPlatformType.WebBrowser for LoginSession constructor, then provide refresh token from Client and then call getWebCookies() - SteamSession will think that provided token is really SteamWeb token and tries to get cookies from web-endpoints, in result refresh token will be canceled by Steam backend (https://github.com/DoctorMcKay/node-steam-session/issues/22).

Better will be updating platform type, instead of throwing error, but it will cause updating transport, which defining in constructor and you may not want to change this.

If you will accept this PR, i suggest to bump version to 1.3.0, because throwing error here may contain breaking changes for some projects.