You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
306 B
14 lines
306 B
2 years ago
|
from quart import session, abort
|
||
|
|
||
|
from functools import wraps
|
||
|
|
||
|
|
||
|
def login_required(func):
|
||
|
@wraps(func)
|
||
|
async def wrapper(*args, **kwargs):
|
||
|
user = session.get('user')
|
||
|
if not isinstance(user, dict):
|
||
|
abort(403)
|
||
|
return await func(*args, **kwargs)
|
||
|
return wrapper
|