aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKanagaraj Manickam <kanagaraj.manickam@huawei.com>2020-09-25 22:04:52 +0530
committerKanagaraj Manickam <kanagaraj.manickam@huawei.com>2020-10-19 22:19:56 +0530
commit590742dfe7dde1975c4bd6074b715fc9f4cc7d11 (patch)
treee9f4342e03fdbb8a1b5f3235084377bf1616b387
parent29ca1f2d2c0127e8bc05270d126b98bfa06fe58e (diff)
Updated naming conventions for login api
Issue-ID: DOVETAIL-801 Signed-off-by: Kanagaraj Manickam <kanagaraj.manickam@huawei.com> Change-Id: I5740c9b2e6acfadd2809b66b722e4f0be0d7c09d
-rw-r--r--opnfv_testapi/ui/auth/sign.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/opnfv_testapi/ui/auth/sign.py b/opnfv_testapi/ui/auth/sign.py
index cfa2e8d..80f7e33 100644
--- a/opnfv_testapi/ui/auth/sign.py
+++ b/opnfv_testapi/ui/auth/sign.py
@@ -296,15 +296,15 @@ class SignoutHandler(base.BaseHandler):
class LoginHandler(base.BaseHandler):
def post(self):
data = json.loads(self.request.body)
- name = data.get('name')
+ userName = data.get('name')
password = data.get('pass')
form_id = 'user_login'
- if not name:
+ if not userName:
raises.Unauthorized(message.req_username())
elif not password:
raises.Unauthorized(message.req_password())
params = {
- "name": name,
+ "name": userName,
"pass": password,
"form_id": form_id,
}
@@ -314,7 +314,7 @@ class LoginHandler(base.BaseHandler):
response_text = response.content
if "unrecognized username or password" in response_text:
raises.Unauthorized(message.invalid_credentials())
- # generate random token
+ #generate random token and store in memcache
token = base.get_token()
resp = {'status': 'success'}
mc = memcache.Client(['127.0.0.1:11211'], debug=0)