aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKanagaraj Manickam <kanagaraj.manickam@huawei.com>2020-09-25 15:51:55 +0530
committerKanagaraj Manickam <kanagaraj.manickam@huawei.com>2020-10-19 22:19:55 +0530
commita94ce6ef25704af2431f8a2ff720f4a4e4fb300e (patch)
tree6f340b94492b8f10ded23c6946c8de449b30b00d
parentfb20d7e9fae54e985800e30adbe80ebad4e8e981 (diff)
Added Token Generation while login
Issue-ID: DOVETAIL-801 Signed-off-by: Kanagaraj Manickam <kanagaraj.manickam@huawei.com> Change-Id: I8acbcf4ce21adfb8c82ec1be7577ed9b5acd094c
-rw-r--r--opnfv_testapi/ui/auth/sign.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/opnfv_testapi/ui/auth/sign.py b/opnfv_testapi/ui/auth/sign.py
index 6a9092a..9652364 100644
--- a/opnfv_testapi/ui/auth/sign.py
+++ b/opnfv_testapi/ui/auth/sign.py
@@ -314,5 +314,8 @@ class LoginHandler(base.BaseHandler):
response_text = response.content
if "unrecognized username or password" in response_text:
raises.Unauthorized(message.invalid_credentials())
+ # generate random token
+ token = base.get_token()
+ self.set_secure_cookie("token", token)
resp = {'status': 'success'}
self.finish_request(resp)