mirror of
https://github.com/NoCrypt/migu.git
synced 2026-01-11 20:10:22 +00:00
Replace the line that removes the linefeed to somewhere that makes more sense
This commit is contained in:
parent
0277b171e0
commit
f165ba8469
1 changed files with 2 additions and 2 deletions
|
|
@ -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: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue