Merge pull request #1867 from hashicorp/issue-1860

Don't panic on bad auth path
This commit is contained in:
Jeff Mitchell 2016-09-08 11:15:44 -04:00 committed by GitHub
commit 3639ecf5ec
1 changed files with 9 additions and 0 deletions

View File

@ -93,6 +93,13 @@ func (c *AuthCommand) Run(args []string) int {
handler = &tokenAuthHandler{Token: token}
args = nil
switch authPath {
case "", "auth/token":
default:
c.Ui.Error("Token authentication does not support custom paths")
return 1
}
}
if handler == nil {
@ -140,6 +147,8 @@ func (c *AuthCommand) Run(args []string) int {
c.Ui.Error(fmt.Sprintf("Error parsing options: %s", err))
return 1
}
} else {
vars = make(map[string]string)
}
// Build the client so we can auth