-
Notifications
You must be signed in to change notification settings - Fork 876
feat: add coder logout command #1609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Closes #1606 |
Short: "Remove local autheticated session", | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
config := createConfig(cmd) | ||
err := os.RemoveAll(string(config)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm just paranoid, but I think this should only remove config.Session()
, config.URL()
and config.Organization()
, and not any other files that happen to have ended up in the directory (at least not without confirmation). I would be worried that a misconfigured CODER_CONFIG_DIR
could lead to somebody accidentally wiping out their home directory.
See e.g. ValveSoftware/steam-for-linux#3671
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I totally agree, we shouldn't delete the folder. I wouldn't put it past that some users are storing a url.bak
or session.bak
. Or any other related material really that they've cooked up themselves.
func logout() *cobra.Command { | ||
return &cobra.Command{ | ||
Use: "logout", | ||
Short: "Remove local autheticated session", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: s/autheticated/authenticated/
A
coder logout
command is useful so users do not have to find and delete the session files manually.