Add test to ensure login command allows multiple users
This commit is contained in:
parent
209aed30b4
commit
c4fcf9ba1a
2 changed files with 29 additions and 39 deletions
|
|
@ -182,19 +182,6 @@ func loginRun(opts *LoginOptions) error {
|
|||
return loginErr
|
||||
}
|
||||
|
||||
existingToken, _ := authCfg.Token(hostname)
|
||||
if existingToken != "" && opts.Interactive {
|
||||
if err := shared.HasMinimumScopes(httpClient, hostname, existingToken); err == nil {
|
||||
keepGoing, err := opts.Prompter.Confirm(fmt.Sprintf("You're already logged into %s. Do you want to re-authenticate?", hostname), false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !keepGoing {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return shared.Login(&shared.LoginOptions{
|
||||
IO: opts.IO,
|
||||
Config: authCfg,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue