We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec573a4 commit ca0e7adCopy full SHA for ca0e7ad
internal/runners/auth/auth.go
@@ -1,9 +1,6 @@
1
package auth
2
3
import (
4
- "os"
5
-
6
- "github.com/ActiveState/cli/internal/constants"
7
"github.com/ActiveState/cli/internal/errs"
8
"github.com/ActiveState/cli/internal/keypairs"
9
"github.com/ActiveState/cli/internal/locale"
@@ -95,8 +92,8 @@ func (a *Auth) authenticate(params *AuthParams) error {
95
92
return auth.AuthenticateWithToken(params.Token, a.Auth)
96
93
}
97
94
98
- if apiKey := os.Getenv(constants.APIKeyEnvVarName); apiKey != "" {
99
- err := auth.AuthenticateWithToken(apiKey, a.Auth)
+ if token := a.Auth.AvailableAPIToken(); token != "" {
+ err := auth.AuthenticateWithToken(token, a.Auth)
100
if err != nil {
101
return errs.Wrap(err, "Failed to authenticate with API key")
102
0 commit comments