mirror of
https://github.com/wolfswolke/DeathGarden_API_Rebirth.git
synced 2026-04-09 10:57:40 -05:00
Fixed Session Validation
This commit is contained in:
parent
1a2fb7f91f
commit
3100242d4e
|
|
@ -181,6 +181,8 @@ def consent_eula():
|
|||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
|
||||
try:
|
||||
mongo.eula(userId=userid, get_eula=False, server=mongo_host, db=mongo_db, collection=mongo_collection)
|
||||
|
|
@ -197,6 +199,8 @@ def consent_eula():
|
|||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
is_given = mongo.get_data_with_list(login=userid, login_steam=False,
|
||||
items={"eula"},
|
||||
server=mongo_host, db=mongo_db, collection=mongo_collection)
|
||||
|
|
@ -227,6 +231,12 @@ def privacy_policy():
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
output = json.load(open(os.path.join(app.root_path, "json", "eula.json"), "r"))
|
||||
return jsonify(output)
|
||||
|
|
@ -241,6 +251,12 @@ def leaderboard_get_scores():
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
if request.method == "POST":
|
||||
logger.graylog_logger(level="info", handler="general-leaderboard-get-scores",
|
||||
message=f"Leaderboard getScores: {request.get_json()}")
|
||||
|
|
@ -268,6 +284,12 @@ def get_quitter_state():
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
logger.graylog_logger(level="info", handler="logging_getQuitterState", message=request.get_json())
|
||||
return jsonify({"status": "success"})
|
||||
|
|
|
|||
|
|
@ -26,6 +26,12 @@ def queue_info():
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
category = request.args.get("category")
|
||||
game_mode = request.args.get("gameMode")
|
||||
region = request.args.get("region")
|
||||
|
|
@ -41,6 +47,12 @@ def queue():
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
|
||||
category = request.json.get("category")
|
||||
rank = request.json.get("rank")
|
||||
|
|
@ -55,11 +67,6 @@ def queue():
|
|||
spoofed_match_id = "0051681e-72ce-46f0-bda2-752e471d0d08"
|
||||
epoch = datetime.now().timestamp()
|
||||
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
|
||||
logger.graylog_logger(level="info", handler="logging_queue",
|
||||
message=f"User {userid} is queueing for {category} in {region} with {count_a} hunters and {count_b} runners")
|
||||
|
||||
|
|
@ -113,6 +120,12 @@ def match(matchid):
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
if matchid == "0051681e-72ce-46f0-bda2-752e471d0d08":
|
||||
return jsonify({"matchId": matchid, "schema": 3,
|
||||
"category": "Steam-te-18f25613-36778-ue4-374f864b",
|
||||
|
|
@ -147,6 +160,12 @@ def match_kill(matchid):
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
logger.graylog_logger(level="info", handler="match_kill", message=f"Match {matchid} has been killed")
|
||||
return jsonify({"status": "OK"})
|
||||
|
||||
|
|
@ -157,14 +176,15 @@ def match_register(match_id):
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
custom_data = request.get_json("customData")
|
||||
if custom_data["sessionSettings"]:
|
||||
session_settings = custom_data["sessionSettings"]
|
||||
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
custom_data = request.get_json("customData")
|
||||
if custom_data["sessionSettings"]:
|
||||
session_settings = custom_data["sessionSettings"]
|
||||
|
||||
logger.graylog_logger(level="info", handler="match_register",
|
||||
message=f"User {userid} is registering to match {match_id}")
|
||||
|
|
@ -180,11 +200,12 @@ def match_quit(match_id):
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
|
||||
logger.graylog_logger(level="info", handler="logging_queue",
|
||||
message=f"User {userid} is quieting match {match_id}")
|
||||
|
|
@ -209,6 +230,8 @@ def match_create():
|
|||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
|
||||
category = request.json.get("category")
|
||||
rank = request.json.get("rank")
|
||||
|
|
@ -233,6 +256,12 @@ def progression_player_end_of_match():
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
logger.graylog_logger(level="info", handler="matchmaking_playerEndOfMatch", message=request.get_json())
|
||||
return jsonify("", 204)
|
||||
|
|
@ -247,6 +276,12 @@ def file_gold_rush(seed, map_name, game_version):
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
|
||||
file_name = f"{game_version}_{seed}_{map_name}.raw"
|
||||
folder_path = os.path.join(app.root_path, "map_seeds")
|
||||
|
|
@ -271,6 +306,12 @@ def metrics_matchmaking_event():
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
logger.graylog_logger(level="info", handler="logging_matchmaking_Event", message=request.get_json())
|
||||
return jsonify({"status": "success"})
|
||||
|
|
|
|||
|
|
@ -7,6 +7,12 @@ def catalog_get(game_version):
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
output = json.load(open(os.path.join(app.root_path, "json", "catalog", game_version, "catalog.json"), "r"))
|
||||
return jsonify(output)
|
||||
|
|
|
|||
|
|
@ -99,6 +99,8 @@ def modifiers():
|
|||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
steamid, token = mongo.get_data_with_list(login=userid, login_steam=False,
|
||||
items={"token", "steamid"}, server=mongo_host, db=mongo_db,
|
||||
collection=mongo_collection)
|
||||
|
|
@ -117,11 +119,13 @@ def moderation_check_username():
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
print(request.get_json())
|
||||
request_var = request.get_json()
|
||||
userid = request_var["userId"]
|
||||
|
|
@ -154,6 +158,12 @@ def progression_experience():
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
logger.graylog_logger(level="info", handler="user_handling_progression_experience", message=request.get_json())
|
||||
return jsonify({"List": [
|
||||
|
|
@ -192,6 +202,12 @@ def challenges_get_challenges():
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
response = request.get_json()
|
||||
challenge_type = response["data"]["challengeType"]
|
||||
|
|
@ -223,6 +239,12 @@ def challenges_execute_challenge_progression_operation_batch():
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
logger.graylog_logger(level="info", handler="logging_executeChallengeProgressionOperationBatch",
|
||||
message=request.get_json())
|
||||
|
|
@ -244,13 +266,15 @@ def inventories():
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
page = request.args.get('page', default=0, type=int)
|
||||
limit = request.args.get('limit', default=500, type=int)
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if page == 0:
|
||||
return jsonify({"Code": 200, "Message": "OK", "Data": {"PlayerId": userid, "Inventory": [
|
||||
{"ObjectId": "56B7B6F6-473712D0-B7A2F992-BB2C16CD", "Quantity": 1, "LastUpdateAt": 16873773050},
|
||||
|
|
@ -303,6 +327,8 @@ def progression_groups():
|
|||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
# This is the real code but need to build this first
|
||||
# return jsonify({"UserId": userid, "StateName": "Fstring", "Segment": "Fstring", "ObjectId": "Fstring",
|
||||
# "Version": 1111, "schemaVersion": 1111, "Data": {}})
|
||||
|
|
@ -333,6 +359,8 @@ def ban_status():
|
|||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
time.sleep(0.5)
|
||||
ban_data = mongo.get_data_with_list(login=userid, login_steam=False,
|
||||
|
|
@ -366,6 +394,12 @@ def get_ban_info():
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
return jsonify({"BanPeriod": None, "BanReason": None, "BanStart": None, "BanEnd": None,
|
||||
"Confirmed": False})
|
||||
|
|
@ -385,6 +419,8 @@ def wallet_currencies():
|
|||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
currencies = mongo.get_data_with_list(login=userid, login_steam=False,
|
||||
items={"currency_blood_cells", "currency_iron", "currency_ink_cells"},
|
||||
|
|
@ -411,6 +447,12 @@ def wallet_currencies_progression():
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
return jsonify([{"Currency": 1, "Amount": 10}, {"Currency": 2, "Amount": 10}, {"Currency": 3, "Amount": 10}])
|
||||
except TimeoutError:
|
||||
|
|
@ -430,6 +472,8 @@ def achievements_get():
|
|||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
return jsonify({"UserId": userid, "StateName": "", "Segment": "", "List": [
|
||||
{"ObjectId": "EFAB89E6465D1163D62A07B11048F2B6", "Version": 11, "SchemaVersion": 11, "Data": {}}
|
||||
]})
|
||||
|
|
@ -450,6 +494,12 @@ def achievements_get():
|
|||
@app.route("/api/v1/messages/count", methods=["GET"])
|
||||
def messages_count():
|
||||
check = check_for_game_client("strict")
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
|
|
@ -465,6 +515,12 @@ def messages_list():
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
limit = request.args.get("limit")
|
||||
output = json.load(open(os.path.join(app.root_path, "json", "placeholders", "messages.json"), "r"))
|
||||
|
|
@ -482,6 +538,12 @@ def moderation_check_chat():
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
data = request.get_json()
|
||||
userid = data["userId"]
|
||||
|
|
@ -501,6 +563,12 @@ def extension_progression_init_or_get_groups():
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
logger.graylog_logger(level="info", handler="logging_initOrGetGroups", message=request.get_json())
|
||||
# Client sends: {"data":{"skipProgressionGroups":false,"skipMetadataGroups":false,"playerName":"Steam-Name-Here"}}
|
||||
|
|
@ -567,6 +635,12 @@ def inventory_unlock_special_items():
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
logger.graylog_logger(level="info", handler="unknown_unlockSpecialItems", message=request.get_json())
|
||||
return jsonify({"UnlockedItems": ["9F54DE7A-4E15935B-503850A1-27B0A2A4"]})
|
||||
|
|
@ -581,6 +655,12 @@ def challenges_get_challenge_progression_batch():
|
|||
check = check_for_game_client("strict")
|
||||
if not check:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
session_cookie = request.cookies.get("bhvrSession")
|
||||
if not session_cookie:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
userid = session_manager.get_user_id(session_cookie)
|
||||
if userid == 401:
|
||||
return jsonify({"message": "Endpoint not found"}), 404
|
||||
try:
|
||||
logger.graylog_logger(level="info", handler="logging_getChallengeProgressionBatch",
|
||||
message=request.get_json())
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import datetime
|
||||
|
||||
from flask_definitions import *
|
||||
import yaml
|
||||
import time
|
||||
|
|
@ -59,9 +61,9 @@ class Session_Manager:
|
|||
return session_id
|
||||
|
||||
def get_user_id(self, session_id):
|
||||
if session_id not in self.sessions or self.sessions[session_id]["expires"] < time.time():
|
||||
return 401
|
||||
self.clean_sessions()
|
||||
if session_id not in self.sessions:
|
||||
return 401
|
||||
self.extend_session(session_id)
|
||||
return self.sessions[session_id]["user"]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user