diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2026-05-24 10:39:02 +0300 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2026-05-24 10:39:02 +0300 |
| commit | d661d2b5ee1e619cd53de79af3f6b16bc2ec5f22 (patch) | |
| tree | e9c5d0e9e8b4f601c0ba62fb3b637da91eafdb56 /src/reader.js | |
| parent | ab8491cfcc34b46eaed06d8d317cd626bf26956d (diff) | |
| download | the-epube-d661d2b5ee1e619cd53de79af3f6b16bc2ec5f22.tar.gz the-epube-d661d2b5ee1e619cd53de79af3f6b16bc2ec5f22.tar.xz | |
split csrf prefilter into separate file, add tsconfig.json for vscodium
Diffstat (limited to 'src/reader.js')
| -rw-r--r-- | src/reader.js | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/reader.js b/src/reader.js index 27f4337..91b6bbf 100644 --- a/src/reader.js +++ b/src/reader.js @@ -36,23 +36,7 @@ class ReaderClass extends AppCommon { async init() { this.csrf_token = Cookie.get('epube_csrf_token'); - console.log('setting prefilter for token', this.csrf_token); - - $.ajaxPrefilter((options, originalOptions/*, jqXHR*/) => { - - if (originalOptions.type !== 'post' || options.type !== 'post') { - return; - } - - const datatype = typeof originalOptions.data; - - if (datatype == 'object') - options.data = $.param($.extend(originalOptions.data, {"csrf_token": this.csrf_token})); - else if (datatype == 'string') - options.data = originalOptions.data + "&csrf_token=" + encodeURIComponent(this.csrf_token); - - console.log('>>>', options); - }); + setupCsrfPrefilter(this.csrf_token); $(document).on("keyup", (e) => { this.hotkeyHandler(e); |
