diff options
author | Kanagaraj Manickam <kanagaraj.manickam@huawei.com> | 2020-09-25 18:53:57 +0530 |
---|---|---|
committer | Kanagaraj Manickam <kanagaraj.manickam@huawei.com> | 2020-10-19 22:19:56 +0530 |
commit | 4b780f978ed5d941f5066f66ec2520f3d9ec1313 (patch) | |
tree | db0a2172b0cbfdc1714f905e78f7b6f21713296e | |
parent | 5e2e95719f26f54db9ecf28847c36098b253b290 (diff) |
Added Logout Dovetail-Webportal
Issue-ID: DOVETAIL-801
Signed-off-by: Kanagaraj Manickam <kanagaraj.manickam@huawei.com>
Change-Id: I298d65141b4c9a795744c7f59e43ca5662103895
-rw-r--r-- | opnfv_testapi/router/url_mappings.py | 3 | ||||
-rw-r--r-- | opnfv_testapi/ui/auth/sign.py | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/opnfv_testapi/router/url_mappings.py b/opnfv_testapi/router/url_mappings.py index 786995a..f529302 100644 --- a/opnfv_testapi/router/url_mappings.py +++ b/opnfv_testapi/router/url_mappings.py @@ -57,7 +57,8 @@ mappings = [ (r'/api/v1/auth/signout', sign.SignoutHandler), (r'/api/v1/profile', user.ProfileHandler), (r'/api/v1/reviews', review_handlers.ReviewsCLHandler), - ('/api/v1/login', sign.LoginHandler) + ('/api/v1/login', sign.LoginHandler), + (r'/api/v1/logout', sign.LogoutHandler) ] diff --git a/opnfv_testapi/ui/auth/sign.py b/opnfv_testapi/ui/auth/sign.py index 0667227..f245c4b 100644 --- a/opnfv_testapi/ui/auth/sign.py +++ b/opnfv_testapi/ui/auth/sign.py @@ -322,3 +322,9 @@ class LoginHandler(base.BaseHandler): mc.set("token", token) self.set_header("token", token) self.finish_request(response) + +class LogoutHandler(base.BaseHandler): + def post(self): + input_token = self.request.headers._dict['Token'] + resp = {'Message': 'You have been logged out successfully.'} + self.finish_request(resp) |