diff options
author | lonkaars <l.leblansch@gmail.com> | 2021-03-25 11:21:52 +0100 |
---|---|---|
committer | lonkaars <l.leblansch@gmail.com> | 2021-03-25 11:21:52 +0100 |
commit | a58a34f4d312cfd392477631215821826db4fa3f (patch) | |
tree | 79c17d4b987357d0f6e77004c7e070e6910fba8f /api/game/random.py | |
parent | 644e0ee607c026831341b1991d1180ef05a0adc5 (diff) |
more login_token -> @auth_required
Diffstat (limited to 'api/game/random.py')
-rw-r--r-- | api/game/random.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/api/game/random.py b/api/game/random.py index 096d5be..7e4c512 100644 --- a/api/game/random.py +++ b/api/game/random.py @@ -6,20 +6,14 @@ import json import random from game.socket import game, games from game.new import create_game, start_game -from auth.login_token import token_login +from hierarchy import auth_required from socket_io import io random_game = Blueprint('random', __name__) @random_game.route('/random') -def index(): - token = request.cookies.get("token") or "" - if not token: - print("a temporary user should be set up here") - - user_id = token_login(token) - if not user_id: return "", 403 - +@auth_required("user") +def index(user_id): public_games = cursor.execute("select game_id from games where private = FALSE and status = \"wait_for_opponent\"").fetchall() game_started = False |