Vault provider error

provider “vault” {
address = local.address
namespace = local.namespace
token = var.vault_token
dynamic “auth_login_jwt” {
for_each = var.vault_token == null ? [true] :
content {
namespace = local.namespace
role = “role1”
mount = “pipeline-ci”
I have the var.vault_token declared and the default is set to null

Every time I run terraform validate etc… I get the error the argument “jwt” is required, but no definition was found.
I have a vault_token set. I’ve tried it as TF_VAR_vault_token and just as vault_token. and I’ve checked the token that the variable is set to, is correct.
If I run it in docker-compose it works. I have TERRAFORM_VAULT_AUTH_JWT=whatever in the docker-compose file.
I’ve tried putting this locally but I still get the error.

What am I missing?