From f165ba84691dad0614c9caf6f5d59a7e0ec022ab Mon Sep 17 00:00:00 2001 From: jubiman Date: Mon, 9 Sep 2024 23:05:40 +0200 Subject: [PATCH] Replace the line that removes the linefeed to somewhere that makes more sense --- common/modules/settings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/modules/settings.js b/common/modules/settings.js index 8ac8145..70bb3e1 100644 --- a/common/modules/settings.js +++ b/common/modules/settings.js @@ -66,6 +66,8 @@ window.addEventListener('paste', ({ clipboardData }) => { if (code.endsWith('/')) code = code.slice(0, -1) if (state.endsWith('/')) state = state.slice(0, -1) if (state.includes('%')) state = decodeURIComponent(state) + // remove linefeed characters from the state + state = state.replace(/(\r\n|\n|\r)/gm, '') handleMalToken(code, state) } } @@ -98,8 +100,6 @@ async function handleMalToken (code, state) { debug(`Failed to get the state and code from MyAnimeList.`) return } - // remove linefeed characters from the state - state = state.replace(/(\r\n|\n|\r)/gm, '') const response = await fetch('https://myanimelist.net/v1/oauth2/token', { method: 'POST', headers: {