nakama-unity icon indicating copy to clipboard operation
nakama-unity copied to clipboard

CORS error when authenticating with wrong credentials (only on WebGL), behaves properly otherwise

Open ghost opened this issue 5 years ago • 7 comments

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.

ghost avatar Apr 03 '20 12:04 ghost

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.

novabyte avatar Apr 03 '20 12:04 novabyte

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 Screenshot_20211129_083932

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.

DreadKnight avatar Nov 29 '21 06:11 DreadKnight

Yep @DreadKnight your specific post is not related to this issue.

mofirouz avatar Nov 29 '21 10:11 mofirouz

@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 avatar Nov 29 '21 10:11 novabyte

@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.

DreadKnight avatar Nov 29 '21 11:11 DreadKnight

I'm don't think this should be closed because the dude above mistook his issue for the same as this.

ghost avatar Oct 04 '22 12:10 ghost

@andreyrk understood -- didn't realize it wasn't the original author. Reopening.

lugehorsam avatar Oct 04 '22 12:10 lugehorsam