diff --git a/src/server.py b/src/server.py index a3a3495..90e502c 100644 --- a/src/server.py +++ b/src/server.py @@ -60,6 +60,7 @@ def add(self, value): @app.route('/login', methods=['GET']) +@optional_auth def login(): config_handler = RuntimeConfig("mysochAuth", app.logger) tenant = tenant_handler.tenant() @@ -221,10 +222,14 @@ def login(): return resp else: target_query.update({'mysoch:unknownidentity': 1}) + parts = parts._replace(query=urlencode(target_query)) + target_url = urlunparse(parts) + resp = make_response(redirect(target_url)) - parts = parts._replace(query=urlencode(target_query)) - target_url = urlunparse(parts) - return make_response(redirect(target_url)) + if identity: + unset_jwt_cookies(resp) + + return resp @app.route('/checklogin', methods=['GET']) @optional_auth