Commit c182e3a54e3987a9d9a5a0fe1674cb97bb358c16

Thomas de Grivel 2022-04-10T20:35:35

do not log invalid csrf protection

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/kmxgit_web/router.ex b/lib/kmxgit_web/router.ex
index 333603a..3fdbcf1 100644
--- a/lib/kmxgit_web/router.ex
+++ b/lib/kmxgit_web/router.ex
@@ -168,7 +168,7 @@ end
   if Mix.env() != :dev do
     use Plug.ErrorHandler
     @impl Plug.ErrorHandler
-    def handle_errors(conn, params = %{reason: Elixir.Plug.CSRFProtection.InvalidCSRFTokenError}) do
+    def handle_errors(conn, %{kind: :error, reason: %Elixir.Plug.CSRFProtection.InvalidCSRFTokenError{}}) do
       send_resp(conn, conn.status, "Error !")
     end
     def handle_errors(conn, params) do