From 80ce94f49bac830ddf7bab22b300b4d034eacc02 Mon Sep 17 00:00:00 2001 From: Alec Fong Date: Fri, 15 Nov 2024 23:07:43 +0000 Subject: [PATCH] fix validation --- pkg/cmd/login/login.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/login/login.go b/pkg/cmd/login/login.go index d6d60278..07a4d109 100644 --- a/pkg/cmd/login/login.go +++ b/pkg/cmd/login/login.go @@ -157,12 +157,12 @@ func (o LoginOptions) RunLogin(t *terminal.Terminal, loginToken string, skipBrow return breverrors.NewValidationError("auth provider must be nvidia or legacy") } - if emailFlag != "" && authProviderFlag != "nvidia" { + authenticator := auth.StandardLogin(authProviderFlag, emailFlag, tokens) + + if emailFlag != "" && authenticator.GetCredentialProvider() != auth.CredentialProviderKAS { return breverrors.NewValidationError("email flag can only be used with nvidia auth provider") } - authenticator := auth.StandardLogin(authProviderFlag, emailFlag, tokens) - o.Auth = auth.NewAuth(o.LoginStore, authenticator) caretType := color.New(color.FgGreen, color.Bold).SprintFunc()