diff --git a/plugin/auth/config.go b/plugin/auth/config.go index 38f8abf86..087241da3 100644 --- a/plugin/auth/config.go +++ b/plugin/auth/config.go @@ -6,9 +6,16 @@ import ( "strings" "github.com/evcc-io/evcc/util" + reg "github.com/evcc-io/evcc/util/registry" "golang.org/x/oauth2" ) +var registry = reg.New[oauth2.TokenSource]("auth") + +func Register(typ string, fun func(map[string]any) (oauth2.TokenSource, error)) { + registry.Add(typ, fun) +} + // NewFromConfig creates auth from configuration func NewFromConfig(ctx context.Context, typ string, other map[string]any) (oauth2.TokenSource, error) { factory, err := registry.Get(strings.ToLower(typ)) diff --git a/plugin/auth/registry.go b/plugin/auth/registry.go deleted file mode 100644 index 63c694370..000000000 --- a/plugin/auth/registry.go +++ /dev/null @@ -1,12 +0,0 @@ -package auth - -import ( - reg "github.com/evcc-io/evcc/util/registry" - "golang.org/x/oauth2" -) - -var registry = reg.New[oauth2.TokenSource]("auth") - -func Register(typ string, fun func(map[string]any) (oauth2.TokenSource, error)) { - registry.Add(typ, fun) -}