mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2026-08-19 13:13:28 +08:00
Fixed steamID not being properly set when cookies have a domain attribute
This commit is contained in:
4
index.js
4
index.js
@@ -165,9 +165,9 @@ SteamCommunity.prototype._setCookie = function(cookie, secure) {
|
||||
|
||||
SteamCommunity.prototype.setCookies = function(cookies) {
|
||||
cookies.forEach((cookie) => {
|
||||
var cookieName = cookie.match(/(.+)=/)[1];
|
||||
var cookieName = cookie.trim().split('=')[0];
|
||||
if (cookieName == 'steamLogin' || cookieName == 'steamLoginSecure') {
|
||||
this.steamID = new SteamID(cookie.match(/=(\d+)/)[1]);
|
||||
this.steamID = new SteamID(cookie.match(/steamLogin(Secure)?=(\d+)/)[2]);
|
||||
}
|
||||
|
||||
this._setCookie(Request.cookie(cookie), !!(cookieName.match(/^steamMachineAuth/) || cookieName.match(/Secure$/)));
|
||||
|
||||
Reference in New Issue
Block a user