Update to v2.3.2

This commit is contained in:
Lost-MSth
2021-04-09 14:42:14 +08:00
parent 62902a561c
commit 941a79ccc7
10 changed files with 160 additions and 91 deletions

View File

@@ -168,9 +168,10 @@ def auth_required(request):
user_id = None
with Connect() as c:
headers = request.headers
token = headers['Authorization']
token = token[7:]
user_id = token_get_id(token)
if 'Authorization' in headers:
token = headers['Authorization']
token = token[7:]
user_id = token_get_id(token)
if user_id is not None:
return view(user_id, *args, **kwargs)