maxlath / wikibase-cli

read and edit a Wikibase instance from the command line
MIT License
227 stars 24 forks source link

Need to re-authenticate any time I upgrade #124

Closed tmtmtmtm closed 4 years ago

tmtmtmtm commented 4 years ago

Every time I upgrade via npm install -g wikibase-cli@latest, the first edit I try to make triggers the reauth disalog:

This operation requires to set your crendentials for https://www.wikidata.org
Which authentication mechanism would you like to use to login to https://www.wikidata.org ?:
/!\ Beware that those will be stored in plain text on your computer
1 - OAuth tokens (recommended)
2 - username - password

(side note: there's also a typo there: "crendentials" instead of "credentials")

I always select 1, then provide all my details again, and everything is fine until the next time I upgrade, at which point it forgets who I am.

(on Mac, node at v14.4, via homebrew)

maxlath commented 4 years ago

my mistake was to try to keep those files in the module directory: I was not encountering the issue as I never have to upgrade from npm ><

from v14.0.0, all local files are saved in the standard home directory (I don't know how standard that is for MacOS though), please see changelogs for how to not loose your credentials a last time while running this upgrade ;)

tmtmtmtm commented 4 years ago

this worked perfectly for me 🎉

(I have no idea either how standard this directory is for macs, but I already have config there for other things)

Thank for a quick fix!

tmtmtmtm commented 4 years ago

Oh, no, I spoke too soon. This actually didn't work for me.

The documentation in the changelog asks me to write my old config to ~/.config/wikibase-cli/config.js but the code actually looks for it in config.json not config.js

Moving the config I generated to that instead works. So fixing this should just be a matter of updating the documentation, rather than any code.

maxlath commented 4 years ago

done in 3ce9d6f, thanks for reporting!

tmtmtmtm commented 4 years ago

👍