fix: remove Cross-Account Data Leakage
This commit is contained in:
+5
-2
@@ -651,7 +651,10 @@ userdata = {
|
|||||||
# -d 'token={token}&id_club={club_id}&language=FR'"""
|
# -d 'token={token}&id_club={club_id}&language=FR'"""
|
||||||
|
|
||||||
|
|
||||||
def refresh_data():
|
def refresh_data(user_data=None):
|
||||||
|
# Use provided user_data or fall back to global userdata for backward compatibility
|
||||||
|
if user_data is None:
|
||||||
|
user_data = userdata
|
||||||
# Print curl equivalent for debugging
|
# Print curl equivalent for debugging
|
||||||
# print(
|
# print(
|
||||||
# curl_for_refresh_data(user_data["token"], user_data["id_club"]), file=sys.stderr
|
# curl_for_refresh_data(user_data["token"], user_data["id_club"]), file=sys.stderr
|
||||||
@@ -659,7 +662,7 @@ def refresh_data():
|
|||||||
with requests.post(
|
with requests.post(
|
||||||
"https://app.myice.hockey/api/mobilerest/refreshdata",
|
"https://app.myice.hockey/api/mobilerest/refreshdata",
|
||||||
headers=mobile_headers,
|
headers=mobile_headers,
|
||||||
data=f"token={userdata['token']}&id_club={userdata['id_club']}&language=FR",
|
data=f"token={user_data['token']}&id_club={user_data['id_club']}&language=FR",
|
||||||
# verify=False,
|
# verify=False,
|
||||||
) as r:
|
) as r:
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
|
|||||||
+8
-8
@@ -352,15 +352,15 @@ async def schedule(
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
if existing_token:
|
if existing_token:
|
||||||
myice.userdata = {
|
user_data = {
|
||||||
"id": userid,
|
"id": userid,
|
||||||
"id_club": club_id or 186,
|
"id_club": club_id or 186,
|
||||||
"token": existing_token,
|
"token": existing_token,
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
myice.userdata = myice.mobile_login(config_section=account)
|
user_data = myice.mobile_login(config_section=account)
|
||||||
|
|
||||||
data = myice.refresh_data()
|
data = myice.refresh_data(user_data=user_data)
|
||||||
if "club_games" in data:
|
if "club_games" in data:
|
||||||
return data["club_games"]
|
return data["club_games"]
|
||||||
else:
|
else:
|
||||||
@@ -433,13 +433,13 @@ async def game(
|
|||||||
config_section=account
|
config_section=account
|
||||||
)
|
)
|
||||||
if existing_token:
|
if existing_token:
|
||||||
myice.userdata = {
|
user_data = {
|
||||||
"id": userid,
|
"id": userid,
|
||||||
"id_club": club_id or 186,
|
"id_club": club_id or 186,
|
||||||
"token": existing_token,
|
"token": existing_token,
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
myice.userdata = myice.mobile_login(config_section=account)
|
user_data = myice.mobile_login(config_section=account)
|
||||||
|
|
||||||
# data = refresh_data()
|
# data = refresh_data()
|
||||||
with requests.post(
|
with requests.post(
|
||||||
@@ -447,11 +447,11 @@ async def game(
|
|||||||
headers=myice.mobile_headers,
|
headers=myice.mobile_headers,
|
||||||
data="&".join(
|
data="&".join(
|
||||||
[
|
[
|
||||||
f"token={myice.userdata['token']}",
|
f"token={user_data['token']}",
|
||||||
f"id_event={game_id}",
|
f"id_event={game_id}",
|
||||||
"type=games",
|
"type=games",
|
||||||
f"id_player={myice.userdata['id']}",
|
f"id_player={user_data['id']}",
|
||||||
f"id_club={myice.userdata['id_club']}",
|
f"id_club={user_data['id_club']}",
|
||||||
"language=FR",
|
"language=FR",
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user