Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to force POST request for logout (django 5) #278

Merged
merged 1 commit into from
Oct 22, 2024
Merged

Conversation

dianekaplan
Copy link
Owner

BUG: logout having an issue in prod: 405 method not allowed

This error occurs because Django's built-in LogoutView expects a POST request for security reasons, to prevent Cross-Site Request Forgery (CSRF) attacks. If you try to log out using a direct URL, which sends a GET request, Django will reject it and show the 405 Error.

Update the 'Log out' link variations to force a POST

@dianekaplan dianekaplan merged commit 96ee513 into main Oct 22, 2024
3 checks passed
@dianekaplan dianekaplan deleted the fix_logout_bug branch October 22, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant