зеркало из https://github.com/docker/hub-tool.git
Do not try to 2FA if the user is not logged-in
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
This commit is contained in:
Родитель
fa9a38c2ec
Коммит
2d6647521a
|
@ -70,15 +70,15 @@ func NewRootCmd(streams command.Streams, hubClient *hub.Client, store credential
|
|||
return nil
|
||||
}
|
||||
|
||||
if cmd.Annotations["sudo"] == "true" {
|
||||
return requireTwoFactorCode(cmd.Context(), streams, hubClient, store)
|
||||
}
|
||||
|
||||
ac, err := store.GetAuth()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if cmd.Annotations["sudo"] == "true" && ac.Username != "" {
|
||||
return requireTwoFactorCode(cmd.Context(), streams, hubClient, store)
|
||||
}
|
||||
|
||||
if ac.Username == "" {
|
||||
log.Fatal(ansi.Error(`You need to be logged in to Docker Hub to use this tool.
|
||||
Please login to Docker Hub using the "hub-tool login" command.`))
|
||||
|
|
Загрузка…
Ссылка в новой задаче