Concepts

State-changing method policy

Try the free JavaScript compiler

A narrow example of a server decision that requires independent authorization and an already verified CSRF result; not a complete implementation.

Formal Syntax & Structure

javascript syntaxjavascript
method === "POST" && authorized && csrfVerified

Working Example

Example Snippetjavascript
(async () => {const permit=(method,authorized,verified)=>method==="POST"&&authorized===true&&verified===true;console.log(permit("GET",true,true),permit("POST",true,true),permit("POST",true,false));})()
JavaScript Reference