Skip to content

Commit

Permalink
fix validation
Browse files Browse the repository at this point in the history
  • Loading branch information
theFong committed Nov 15, 2024
1 parent d08c877 commit 80ce94f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/cmd/login/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 80ce94f

Please sign in to comment.