Blacksmoke16 / GESI

Google Sheets™ ESI Add-on
https://blacksmoke16.github.io/GESI
MIT License
195 stars 37 forks source link

Character ID mismatch between request path and auth token #76

Closed ghost closed 3 years ago

ghost commented 3 years ago

Now that GESI is available again as addon I installed it and authorized 2 of my characters. It seems though that auth-related function calls have some issue. This probably isn't a library issue per-se but I can't figure out what the issue is. I've followed the setup instructions as well as the instructions to using the GESI library from the script editor. The error is the same when calling the functions from the sheet itself and from a function within the script editor.

I tested with

All where tested without explicit character name and with the name of one of the authorized characters. Results are the same This is the execution log when calling characters_character_standings:

Error: {"error":"Character ID mismatch between request path and auth token"}
doRequest @ esi_client.gs:184
execute @ esi_client.gs:90
invoke @  gesi.gs:171
characters_character_standings @ functions.gs:666

I've included GESI Library version 35 in the script editor but as said, the error is the same when calling the GESI function directly from the sheet. When I call getAuthenticatedCharacterNames() from the sheet, it does indeed show both characters being authenticated.

Blacksmoke16 commented 3 years ago

@MrOnak Were you using a local install while GESI wasn't available? Doing a GESI => Reset, then reauthing your two chars would probably fix this regardless.

ghost commented 3 years ago

@Blacksmoke16 no the google document is relatively new, it has never had any version of GESI. Regardless I did a reset and reauthenticated the characters - no change.

Blacksmoke16 commented 3 years ago

@MrOnak Hmm. I've seen this happen in the past when auth data gets corrupted, normally a reset fixes it. I noticed that I'm not clearing cache after a reset, so it's possible the invalid token was still hanging around. Could you give it another try as the token would have expired by now. Also might be worth trying a diff sheet.

If that doesn't fix it would you be willing to have a chat via discord to see if we can figure out what's causing this?

ghost commented 3 years ago

Sure we can do discord. I'll be online for at least another 2h hours What is your handle?

by the way I tried GESI on a new sheet. The addon is already installed but none of the functions can be found.

Blacksmoke16 commented 3 years ago

I'm @blacksmoke16#0016.

Blacksmoke16 commented 3 years ago

For posterity, this is a result of Firefox behaving differently than Chrome. In Chrome, after you auth a character the auth modal closes. However in the case of Firefox, since you have to open the SSO button in a new tab, this does not happen. This causes auth data to become corrupted.

I'm going to look into why Firefox just can't click on the button in the first place. For now a workaround to this would be to closing/reopening the auth modal for each character like you have to on Chrome.

ghost commented 3 years ago

Thanks for the debug session. As mentioned, closing the modal works.