Wikidata-Toolkit
Wikidata-Toolkit copied to clipboard
Logging out should not fail if we are already logged out
Originally posted at https://github.com/OpenRefine/OpenRefine/issues/2873 by @addshore
Describe the bug
If I am logged into wikidata, but my session expires or I get logged out for some reason I can not use the log out button in the app.
Current Results
When I do click logout I see the following in the console and the app continues to think that I am logged in.
17:33:56.920 [ refine] GET /command/wikidata/login (9487ms)
17:33:56.948 [ refine] POST /command/core/get-all-preferences (28ms)
17:33:58.792 [ refine] GET /command/core/get-csrf-token (1844ms)
17:33:58.807 [ refine] POST /command/wikidata/login (15ms)
17:33:59.078 [ connection_mananger] [assertuserfailed] You are no longer logged in, so the action could not be completed. (271ms)
This is probably due to the assertuser option being used for this login call?
Expected behaviour
Clicking the logout button in this situation should detect that I am no longer logged in and thus allow me to re login to the app.
Screenshots
Stuck here in the app, can not log out

Desktop:
- OS: Windows 10
- Browser Version: Firefox 76.0.1 (64-bit)
- JRE or JDK Version:
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
OpenRefine :
- Version 3.3
I would either:
- make sure logout calls are made without
assert=parameter - but perhaps that is not a good idea: do we still want to fail if I try to logout thinking I am logged in as Mary, but in fact I am logged in as John? - catch
assertuserfailedourselves and pretend logout failed? - document that this can happen and require our users to call
checkCredentialsbefore?