fix(rpc): render canonical csrf token for clients
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user