Browse Source

Strategická: Přihlašování tokenem kdekoliv

Zejména z důvodu generování animace
master
Jiří Kalvoda 2 years ago
parent
commit
26894cd256
  1. 3
      server/hra/web/__init__.py

3
server/hra/web/__init__.py

@ -59,14 +59,11 @@ def init_request():
user = None user = None
g.user = None g.user = None
g.org = False g.org = False
if path.startswith('/api/'):
token = request.args.get('token') token = request.args.get('token')
if token is not None: if token is not None:
user = db.get_session().query(db.User).filter_by(token=token).first() user = db.get_session().query(db.User).filter_by(token=token).first()
if user is None: if user is None:
raise werkzeug.exceptions.Forbidden("Wrong token.") raise werkzeug.exceptions.Forbidden("Wrong token.")
else:
if 'uid' in session: if 'uid' in session:
user = db.get_session().query(db.User).filter_by(id=session['uid']).first() user = db.get_session().query(db.User).filter_by(id=session['uid']).first()
path = request.path path = request.path

Loading…
Cancel
Save