aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 f245c4b..6b70d1a 100644
--- a/opnfv_testapi/ui/auth/sign.py
+++ b/opnfv_testapi/ui/auth/sign.py
@@ -325,6 +325,9 @@ class LoginHandler(base.BaseHandler):
class LogoutHandler(base.BaseHandler):
def post(self):
+ token=self.get_secure_cookie('token')
input_token = self.request.headers._dict['Token']
+ if not input_token or not input_token == token :
+ raises.Unauthorized(message.invalid_token())
resp = {'Message': 'You have been logged out successfully.'}
self.finish_request(resp)