MCPcopy Create free account
hub / github.com/error311/FileRise / primeCsrfStrict

Function primeCsrfStrict

public/js/auth.js:566–573  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

564
565/* ----------------- Authentication Submission ----------------- */
566async function primeCsrfStrict() {
567 const r = await fetch('/api/auth/token.php', { credentials: 'include' });
568 const j = await r.json().catch(() => ({}));
569 if (!r.ok || !j.csrf_token) throw new Error('CSRF missing');
570 window.csrfToken = j.csrf_token;
571 const m = document.querySelector('meta[name="csrf-token"]');
572 if (m) m.content = j.csrf_token;
573}
574
575function toFormBody(obj) {
576 const p = new URLSearchParams();

Callers 1

submitLoginFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected