diff --git a/internal/cli/auth/login.go b/internal/cli/auth/login.go index 9ac3c8ef48..9ab7cc0f33 100644 --- a/internal/cli/auth/login.go +++ b/internal/cli/auth/login.go @@ -16,6 +16,7 @@ package auth import ( "context" + "errors" "fmt" "os" "time" @@ -160,6 +161,10 @@ Your code will expire after %.0f minutes. } accessToken, _, err := opts.flow.PollToken(ctx, code) + var target *atlas.ErrorResponse + if errors.As(err, &target) && target.ErrorCode == "DEVICE_AUTHORIZATION_EXPIRED" { + return errors.New("authentication timed out") + } if err != nil { return err }