chiyadev / genshin-schedule

🕑 Genshin farming scheduler
https://genshin.chiya.dev
MIT License
72 stars 17 forks source link

NetworkError when trying to log in on Firefox #8

Closed jgierer12 closed 3 years ago

jgierer12 commented 3 years ago

Hi, first of all thanks for making this website!

I tried using the new sync feature today, but I wasn't able to log in on Firefox. For a brief moment, the red notification text below the submit button changes to NetworkError when attempting to fetch resource, and then the page reloads. I then tried signing in with the same username-password combination on a Chromium-based browser which worked flawlessly.

I tried investigating the issue, but it started going over my head pretty quickly. The authentication request is shown as "blocked" in the Network tab (see below), which after a quick google search might be related to too many simultaneous connections to the server? I'm not sure how that could be the case here though.

image

These two links might explain part of what's going on:

https://stackoverflow.com/questions/43783829/what-does-blocked-really-mean-in-the-firefox-developer-tools-network-monitorin https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor/request_details#Request_Timing

Here is my relevant system info in case you need any of it:

luaneko commented 3 years ago

Thanks for the detailed report! I've pushed a fix for this just now, so you should now able to sign in on Firefox.

Firefox seems to interpret the submit button as a traditional HTML form and try to POST a network request automatically, but we use React and bind our own auth logic to the button click event. Preventing the event from propagating fixed the issue.

jgierer12 commented 3 years ago

Thanks for the quick fix!