Don't panic on bad auth path

Fixes #1860
This commit is contained in:
Jeff Mitchell 2016-09-08 11:14:47 -04:00
parent 7ba006acd9
commit 7e5aef279c
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