mirror of
https://github.com/wolfswolke/DeathGarden_API_Rebirth.git
synced 2026-07-14 15:51:13 -05:00
Added bhvrSession.md
This commit is contained in:
parent
b9de01f936
commit
bcae59efd5
24
Doc/bhvrSession.md
Normal file
24
Doc/bhvrSession.md
Normal file
|
|
@ -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": []}})
|
||||
```
|
||||
Loading…
Reference in New Issue
Block a user