Skip to content

Commit 231cf0d

Browse files
authored
Merge pull request #28 from takker99/fix-csrf
🐛 s/__csrf/_csrf
2 parents 58ede69 + 02df1f0 commit 231cf0d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rest/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getProfile } from "./profile.ts";
44
// scrapbox.io内なら`window._csrf`にCSRF tokenが入っている
55
declare global {
66
interface Window {
7-
__csrf?: string;
7+
_csrf?: string;
88
}
99
}
1010

@@ -22,7 +22,7 @@ export type Result<T, E> = { ok: true; value: T } | { ok: false; value: E };
2222
export async function getCSRFToken(
2323
sid?: string,
2424
): Promise<string> {
25-
if (window.__csrf) return window.__csrf;
25+
if (window._csrf) return window._csrf;
2626

2727
const user = await getProfile(sid ? { sid } : undefined);
2828
return user.csrfToken;

0 commit comments

Comments
 (0)