mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Fixed API argument issues
This commit is contained in:
@@ -6,10 +6,13 @@ class APIKeyAuthentication(object):
|
|||||||
|
|
||||||
def is_authenticated(self, request):
|
def is_authenticated(self, request):
|
||||||
|
|
||||||
apikey = request.GET.get('apikey', None)
|
params = {}
|
||||||
if apikey:
|
for key,value in request.GET.items():
|
||||||
|
params[key.lower()] = value
|
||||||
|
|
||||||
|
if params['apikey']:
|
||||||
try:
|
try:
|
||||||
keyobj = AuthAPIKey.objects.get(key=apikey)
|
keyobj = AuthAPIKey.objects.get(key=params['apikey'])
|
||||||
except:
|
except:
|
||||||
keyobj = None
|
keyobj = None
|
||||||
|
|
||||||
|
|||||||
@@ -107,8 +107,8 @@ class EveAPIProxyHandler(BaseHandler):
|
|||||||
for key,value in request.GET.items():
|
for key,value in request.GET.items():
|
||||||
params[key.lower()] = value
|
params[key.lower()] = value
|
||||||
|
|
||||||
if request.GET.get('userid', None):
|
if 'userid' in params:
|
||||||
obj = get_object_or_404(EVEAccount, pk=request.GET.get('userid', None))
|
obj = get_object_or_404(EVEAccount, pk=params['userid'])
|
||||||
params['apikey'] = obj.api_key
|
params['apikey'] = obj.api_key
|
||||||
|
|
||||||
print params
|
print params
|
||||||
|
|||||||
Reference in New Issue
Block a user