Skip to content

Commit

Permalink
Merge pull request #13309 from PennyDreadfulMTG/cookie-hell
Browse files Browse the repository at this point in the history
Move from pennydreadfulmagic.com cookies to .pennydreadfulmagic.com cookies
  • Loading branch information
mergify[bot] authored Nov 12, 2024
2 parents ad20b34 + 67f1c16 commit 85076b6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions shared_web/flask_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,14 @@ def logout(self) -> wrappers.Response:
oauth.logout()
target = request.args.get('target', 'home')
if bool(urllib.parse.urlparse(target).netloc):
return redirect(target)
return redirect(url_for(target))
response = redirect(target)
else:
response = redirect(url_for(target))
# Clean up any session cookie set with no domain created when the site was misconfigured.
# If we don't then you won't actually log out, we'll keep respecting the no-domain cookie.
# The cookies we actually want are set with domain=.pennydreadfulmagic.com so they work on subdomains.
response.delete_cookie('session', domain=None)
return response

def authenticate(self) -> wrappers.Response:
target = request.args.get('target')
Expand Down

0 comments on commit 85076b6

Please sign in to comment.