fix(rpc): render canonical csrf token for clients
Quality / quality (ubuntu-latest) (push) Failing after 9m46s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
2026-08-12 18:20:14 +05:30
parent 0f201c9767
commit f73fbb7aba
4 changed files with 36 additions and 1 deletions
+6 -1
View File
@@ -4138,8 +4138,13 @@ export const REACTIVE_RUNTIME = String.raw`
}
function callServerFunction(component, functionName, args) {
var csrfMeta = document.querySelector('meta[name="wrnexus-csrf"]');
var csrfMatch = /(?:^|;\s*)wire-csrf=([^;]+)/.exec(document.cookie || "");
var csrf = csrfMatch ? decodeURIComponent(csrfMatch[1]) : "";
var csrf = csrfMeta
? csrfMeta.getAttribute("content") || ""
: csrfMatch
? decodeURIComponent(csrfMatch[1])
: "";
return fetch("/__wrnexus/rpc", {
method: "POST",
credentials: "same-origin",