From 02df1f0e6168cf79b3a25e4942498f628178bc87 Mon Sep 17 00:00:00 2001 From: takker99 <37929109+takker99@users.noreply.github.com> Date: Thu, 24 Mar 2022 21:57:46 +0900 Subject: [PATCH] :bug: s/__csrf/_csrf --- rest/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest/utils.ts b/rest/utils.ts index f8a9a81..c0c5ce6 100644 --- a/rest/utils.ts +++ b/rest/utils.ts @@ -4,7 +4,7 @@ import { getProfile } from "./profile.ts"; // scrapbox.io内なら`window._csrf`にCSRF tokenが入っている declare global { interface Window { - __csrf?: string; + _csrf?: string; } } @@ -22,7 +22,7 @@ export type Result = { ok: true; value: T } | { ok: false; value: E }; export async function getCSRFToken( sid?: string, ): Promise { - if (window.__csrf) return window.__csrf; + if (window._csrf) return window._csrf; const user = await getProfile(sid ? { sid } : undefined); return user.csrfToken;