From 20dc7f6dc81d319a43603d58136061fc9892a60e Mon Sep 17 00:00:00 2001 From: Samuel Girardin Date: Fri, 29 Oct 2021 15:11:46 +0200 Subject: [PATCH] fix csrf token again --- src/masonite/inertia/middleware/InertiaMiddleware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/masonite/inertia/middleware/InertiaMiddleware.py b/src/masonite/inertia/middleware/InertiaMiddleware.py index 71418da..7c39c67 100644 --- a/src/masonite/inertia/middleware/InertiaMiddleware.py +++ b/src/masonite/inertia/middleware/InertiaMiddleware.py @@ -36,7 +36,7 @@ def after(self, request, response): # in a X-XSRF-TOKEN header in the subsequent request # It's important that, the cookie has not HttpOnly and Secure as discussed # here: https://stackoverflow.com/a/54132068/15131933 - request.cookie("XSRF-TOKEN", request.cookie("csrf_token"), secure=False, http_only=False) + response.cookie("XSRF-TOKEN", request.cookie("csrf_token"), secure=False, http_only=False) return response def is_inertia_request(self, request):