nakama-unity
nakama-unity copied to clipboard
CORS error when authenticating with wrong credentials (only on WebGL), behaves properly otherwise
CORS blocks XMLHttpRequest and throws No 'Access-Control-Allow-Origin' header is present on the requested resource..
Happens only on WebGL and when trying to authenticate with invalid credentials (e.g what should throw invalid e-mail format, incorrect password or other useful logs, instead throws a CORS error and no information about what actually failed).
Non-WebGL platforms throw proper ApiResponseException. PS: I assume this is not server-related as I use the same server for a Godot project. FWIW the WebGL version is hosted at: https://kag-rewritten.github.io/ (and code at respective repo) if you feel the description is not enough.
Thanks for the report @andreyrk. I'll see what we can do to make sure the OPTIONS request succeeds even if the underlying HTTP request returns a non-200 status code.
And now all of a sudden I have issues with this CORS stuff as well; stuff been working fine for months now without changes sigh

Trying to log in or make new account but nothing works properly. Not sure how to handle this so far...
Edit: Seems my issue was with DigitalOcean as it stopped my droplet since it didn't took money from PayPal automatically. Also, Google started showing the CORS stuff in the console rather recently, confusing me even more; it can be disabled heh.
Yep @DreadKnight your specific post is not related to this issue.
@DreadKnight Based on your post it appears your project was working fine but now does not connect due to CORS. Is this correct? If so, what have you changed that could have caused the connectivity differences?
@novabyte I edited post before with answer/solution in my case. Basically CORS wasn't an issue, just adding to the confusion. DigitalOcean disabled my droplet cause it can't get money from PayPal by itself, game was saying that login is not valid, not that it couldn't connect to server... at least I didn't wasted days on this like in other lamer scenarios. Tech, 1000 things that can go wrong.
I'm don't think this should be closed because the dude above mistook his issue for the same as this.
@andreyrk understood -- didn't realize it wasn't the original author. Reopening.