gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-bank] branch master updated: authenticating /history


From: gnunet
Subject: [GNUnet-SVN] [taler-bank] branch master updated: authenticating /history request
Date: Thu, 30 Mar 2017 17:21:21 +0200

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository bank.

The following commit(s) were added to refs/heads/master by this push:
     new 22945cf  authenticating /history request
22945cf is described below

commit 22945cf482b676526812c8fb0aac13258bf40929
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Mar 30 17:21:20 2017 +0200

    authenticating /history request
---
 talerbank/app/views.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index 577f719..bd544ee 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -345,6 +345,14 @@ def history(request):
     try: schemas.validate_history(data)
     except ValueError:
         return HttpResponseBadRequest()
+    user_account = django.contrib.auth.authenticate(username=data["username"],
+                                                    password=data["password"])
+    if user_account is None:
+        return JsonResponse({"outcome": "fail",
+                             "hint": "authentication failed"},
+                             status=401)
+
+
     return HttpResponse(200)
 
 
@@ -365,7 +373,6 @@ def add_incoming(request):
         schemas.validate_incoming_request(data)
     except ValueError:
         return HttpResponseBadRequest()
-    # authenticate the user
     user_account = django.contrib.auth.authenticate(username=data["username"],
                                                     password=data["password"])
     if user_account is None:

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]