Skip to content

Commit

Permalink
Unset any existing auth cookie if identity is unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Sep 26, 2024
1 parent 721bcf7 commit d5382f2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d5382f2

Please sign in to comment.