sematext / logsene-cli

Logsene Command-line Interface
http://sematext.com/logsene
Apache License 2.0
10 stars 5 forks source link

Add logout command #11

Open mbonaci opened 5 years ago

mbonaci commented 5 years ago

Now that users have to choose region during login, we should allow them to logout from the active session in order to switch between regions and Log applications.

Currently, the only way to force logout (short of waiting 30 min) is to manually delete the session config file at ~/.config/configstore/logsene/<user>.json or to remove apiKey and/or token from it.

otisg commented 5 years ago

Could/should the implementation just delete that file then?

mbonaci commented 5 years ago

We keep some across-sessions params there that user can set, like default-size, range-separator and trace.
It's even simpler than having to deal with files - we'll just invoke configSet with empty value for apiKey, token and region.
(Implementation detail: configSet should in turn invoke existing function config.deleteSync when value is empty)

Any command after this will ask user to login first.