Skip to content

Commit

Permalink
Rename CSRF_TRUSTED_ORIGIN to CSRF_TRUSTED_ORIGINS
Browse files Browse the repository at this point in the history
  • Loading branch information
vincevd1 committed May 15, 2024
1 parent 6af1911 commit f8d5751
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions client/src/components/popup.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type PopupProps = {
title: string,
children: React.ReactNode | ((close: () => void, isOpen: boolean) => React.ReactNode),
button: React.ReactElement
onPopupClose: () => void
onPopupClose?: () => void
}

export default function Popup({ title, children, button, onPopupClose}: PopupProps) {
Expand All @@ -21,7 +21,7 @@ export default function Popup({ title, children, button, onPopupClose}: PopupPro
if(isOpen) {
getPopupRoot().remove()
setIsOpen(false);
onPopupClose();
if(onPopupClose) onPopupClose();

document.body.style.overflow = "auto";
}
Expand Down
2 changes: 1 addition & 1 deletion server/server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
CORS_ORIGIN_ALLOW_ALL = DEBUG

ALLOWED_HOSTS = ["localhost", "localhost:5173","127.0.0.1"] if DEBUG else [SITE_DOMAIN]
CSRF_TRUSTED_ORIGIN = [BASE_URL]
CSRF_TRUSTED_ORIGINS = [BASE_URL]

ROOT_URLCONF = "server.urls"

Expand Down
1 change: 0 additions & 1 deletion server/server/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from . import views

urlpatterns = [
path("", views.redirected),
path("admin/", admin.site.urls),
path("api/", include("api.urls")),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
4 changes: 0 additions & 4 deletions server/server/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
from django.shortcuts import redirect

def redirected(request):
return redirect('http://localhost:5173')

0 comments on commit f8d5751

Please sign in to comment.