sylveon / discord-ban-appeals

Sample ban appeals page with OAuth2 integration
https://discord-ban-appeal-preview.netlify.app/
MIT License
137 stars 45 forks source link

Submit appeal form error message #35

Closed OviiiOne closed 2 years ago

OviiiOne commented 2 years ago

Hi, out of the blue users are unable to submit appeals on my server.

I have forked this repo and just translated some things to have it in Spanish, last week it was working just fine.

Now whenever they try to send the form (after logging in) they receive this message:

{"errorType":"SyntaxError","errorMessage":"Unexpected token ] in JSON at position 44","trace":["SyntaxError: Unexpected token ] in JSON at position 44"," at JSON.parse (<anonymous>)"," at Runtime.exports.handler (/var/task/func/submit-appeal.js:37:35)"," at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"]}

I tried to check if there was an error in the code, but I can't find the file submit-appeal.js and I don't know what to do.

sylveon commented 2 years ago

Am I right in assuming you're using Netlify forms? Does the issue happens if you stop using those and instead use a webhook?

OviiiOne commented 2 years ago

I do have netlify forms, but I don't know how to use a webhook instead >_<

I just clicked on deploy to netlify and then did the changes on my fork, so I guess that the form was enabled through the netlify button.

OviiiOne commented 2 years ago

Solved the problem, it wasn't related to netlify forms nor webhooks.

I added an extra comma at the end of the BLOCKED_USERS env variable that caused that error to appear when trying to send the form.

sylveon commented 2 years ago

Good find! I'll trim out commas from the environment variable to make it less likely to happen.