feat: mask coder login token to enhance security (#12948)

* feat(login): treat coder token as a secret

* Update login.go
This commit is contained in:
Michael Brewer 2024-05-03 14:03:13 -07:00 committed by GitHub
parent 205c43da99
commit 060f023174
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -287,7 +287,8 @@ func (r *RootCmd) login() *serpent.Command {
}
sessionToken, err = cliui.Prompt(inv, cliui.PromptOptions{
Text: "Paste your token here:",
Text: "Paste your token here:",
Secret: true,
Validate: func(token string) error {
client.SetSessionToken(token)
_, err := client.User(ctx, codersdk.Me)