mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Fix the authentication handler to actually work
This commit is contained in:
@@ -15,12 +15,18 @@ class V2AuthenticationHandler(BaseHandler):
|
|||||||
|
|
||||||
allowed_methods = ('GET')
|
allowed_methods = ('GET')
|
||||||
|
|
||||||
def read(self, request, username, password):
|
def read(self, request):
|
||||||
"""
|
"""
|
||||||
Validates login details for the provided user as
|
Validates login details for the provided user as
|
||||||
long as 'username' and 'password' are provided.
|
long as 'username' and 'password' are provided.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
username = request.GET.get('username', None)
|
||||||
|
password = request.GET.get('password', None)
|
||||||
|
|
||||||
|
if not username or not password:
|
||||||
|
return rc.BAD_REQUEST
|
||||||
|
|
||||||
try:
|
try:
|
||||||
user = User.object.get(username=username)
|
user = User.object.get(username=username)
|
||||||
except User.DoesNotExist:
|
except User.DoesNotExist:
|
||||||
|
|||||||
Reference in New Issue
Block a user