forked from rDrama/rDrama
Fix chat by setting g.timestamp.
The users online count recently added to wrappers.py:get_logged_in_user uses g.timestamp for its calculations. This is primarily set in __main__.py:before_request. However, chat has requests which do not trigger @app.before_request. To resolve this, we now set g.timestamp in the auth_required wrapper before calling get_logged_in_user(). I think this is safe in general; there's no particular harm to setting the timestamp _more_ frequently.master
parent
42d810a5e7
commit
67796acc11
|
@ -75,7 +75,7 @@ def auth_desired(f):
|
|||
def auth_required(f):
|
||||
|
||||
def wrapper(*args, **kwargs):
|
||||
|
||||
g.timestamp = int(time.time())
|
||||
v = get_logged_in_user()
|
||||
if not v: abort(401)
|
||||
|
||||
|
|
Loading…
Reference in New Issue