From 5adaae83f9e63b1a41390d7d9a059e3847a44f1b Mon Sep 17 00:00:00 2001 From: LaxmanMaharjan Date: Fri, 20 May 2022 19:58:16 +0545 Subject: [PATCH] checking if user token is black listed(logged out) before giving access to UserAPI --- project/server/auth/views.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/project/server/auth/views.py b/project/server/auth/views.py index ab12889..01e154e 100644 --- a/project/server/auth/views.py +++ b/project/server/auth/views.py @@ -99,6 +99,13 @@ def get(self): if auth_header: try: auth_token = auth_header.split(" ")[1] + if BlacklistToken.check_blacklist(auth_token): + responseObject = { + 'status': 'fail', + 'message': 'User Logged Out Already. Please Login Again.' + } + return make_response(jsonify(responseObject)), 401 + except IndexError: responseObject = { 'status': 'fail',