Skip to content

Commit

Permalink
Add error for when no login/no token
Browse files Browse the repository at this point in the history
  • Loading branch information
maidul98 committed Jan 10, 2023
1 parent b702f29 commit 60a03ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 39 deletions.
38 changes: 0 additions & 38 deletions cli/packages/util/errors.go

This file was deleted.

4 changes: 3 additions & 1 deletion cli/packages/util/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ func GetAllEnvironmentVariables(envName string) ([]models.SingleEnvironmentVaria
secrets, err := GetPlainTextSecretsViaJTW(loggedInUserDetails.UserCredentials.JTWToken, loggedInUserDetails.UserCredentials.PrivateKey, workspaceFile.WorkspaceId, envName)
return secrets, err

} else {
} else if infisicalToken != "" {
log.Debug("Trying to fetch secrets using service token")
return GetPlainTextSecretsViaServiceToken(infisicalToken)
} else {
return nil, fmt.Errorf("unable to fetch secrets because we could not find a service token or a logged in user")
}
}

Expand Down

0 comments on commit 60a03ca

Please sign in to comment.