Skip to content

Commit

Permalink
fixes #274 empty token issue (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnybod authored Aug 11, 2020
1 parent 85f3726 commit d68a952
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions empire
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,12 @@ def start_restful_api(empireMenu, suppress=False, username=None, password=None,
try:
if request.path != '/api/admin/login':
token = request.args.get('token')
user = u.get_user_from_token(token)
if user:
g.user = user
if token and len(token) > 0:
user = u.get_user_from_token(token)
if user:
g.user = user
else:
return make_response('', 401)
else:
return make_response('', 401)
except:
Expand Down

0 comments on commit d68a952

Please sign in to comment.