diff --git a/caddyfile_authn_transform.go b/caddyfile_authn_transform.go index d651601..e073a1d 100644 --- a/caddyfile_authn_transform.go +++ b/caddyfile_authn_transform.go @@ -17,6 +17,7 @@ package security import ( "github.com/caddyserver/caddy/v2" "github.com/caddyserver/caddy/v2/caddyconfig/caddyfile" + "github.com/greenpau/caddy-security/pkg/util" "github.com/greenpau/go-authcrunch/pkg/authn" "github.com/greenpau/go-authcrunch/pkg/authn/transformer" cfgutil "github.com/greenpau/go-authcrunch/pkg/util/cfg" @@ -29,8 +30,8 @@ func parseCaddyfileAuthPortalTransform(h *caddyfile.Dispenser, repl *caddy.Repla case "user", "users": tc := &transformer.Config{} for nesting := h.Nesting(); h.NextBlock(nesting); { - trKey := h.Val() - trArgs := h.RemainingArgs() + trKey := util.FindReplace(repl, h.Val()) + trArgs := util.FindReplaceAll(repl, h.RemainingArgs()) trArgs = append([]string{trKey}, trArgs...) encodedArgs := cfgutil.EncodeArgs(trArgs) var matchArgs bool