mirror of
https://github.com/Lost-MSth/Arcaea-server.git
synced 2026-02-08 16:57:26 +08:00
[Enhance] Cloud save update scores & capture auth error
- Restore the feature that cloud save can be used to cover best scores - Capture error that the request does not have `Authorization` in header
This commit is contained in:
@@ -53,7 +53,10 @@ def auth_required(request):
|
||||
with Connect() as c:
|
||||
try:
|
||||
user = UserAuth(c)
|
||||
user.token = headers['Authorization'][7:]
|
||||
token = headers.get('Authorization')
|
||||
if not token:
|
||||
raise NoAccess('No token.', -4)
|
||||
user.token = token[7:]
|
||||
user_id = user.token_get_id()
|
||||
g.user = user
|
||||
except ArcError as e:
|
||||
|
||||
Reference in New Issue
Block a user