From bcae59efd5a9f1720ddb18cc94663bc59d58653c Mon Sep 17 00:00:00 2001 From: ZKWolf Date: Fri, 16 Jun 2023 23:53:24 +0200 Subject: [PATCH] Added bhvrSession.md --- Doc/bhvrSession.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Doc/bhvrSession.md diff --git a/Doc/bhvrSession.md b/Doc/bhvrSession.md new file mode 100644 index 0000000..f71f2ef --- /dev/null +++ b/Doc/bhvrSession.md @@ -0,0 +1,24 @@ +## bhvrSession Cookie + +The Steam Login Function (see Steam_Login.md) returns the Cookie bhvrSession with the Value UserID (User ID is a custome Value generated by the MongoDB handler). + +The Client then adds this Cookie to every following request. + +This is done so that the API knows which user data to return. + +# Login Endpoint +/api/v1/auth/provider/steam/login + +# Retrieving Cookie + +```python +userid = request.cookies.get('bhvrSession') +``` +# Usage example +Request +```python +@app.route("/api/v1/inventories", methods=["GET"]) +def inventories(): + userid = request.cookies.get('bhvrSession') + return jsonify({"code": 200, "message": "OK", "data": {"playerId": userid, "inventory": []}}) +```