From dc4b97b8514943abbdcc72556ea01d68f2230b40 Mon Sep 17 00:00:00 2001 From: rithu john Date: Mon, 1 May 2017 15:53:37 -0700 Subject: [PATCH] cmd/dex/serve: add local connector directly to static connectors in storage --- cmd/dex/serve.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/cmd/dex/serve.go b/cmd/dex/serve.go index 8ee58b77..78194161 100644 --- a/cmd/dex/serve.go +++ b/cmd/dex/serve.go @@ -147,15 +147,6 @@ func serve(cmd *cobra.Command, args []string) error { s = storage.WithStaticPasswords(s, passwords) } - if c.EnablePasswordDB { - c.StaticConnectors = append(c.StaticConnectors, Connector{ - ID: server.LocalConnector, - Name: "Email", - Type: server.LocalConnector, - }) - logger.Infof("config connector: local passwords enabled") - } - storageConnectors := make([]storage.Connector, len(c.StaticConnectors)) for i, c := range c.StaticConnectors { if c.ID == "" || c.Name == "" || c.Type == "" { @@ -174,6 +165,16 @@ func serve(cmd *cobra.Command, args []string) error { storageConnectors[i] = conn } + + if c.EnablePasswordDB { + storageConnectors = append(storageConnectors, storage.Connector{ + ID: server.LocalConnector, + Name: "Email", + Type: server.LocalConnector, + }) + logger.Infof("config connector: local passwords enabled") + } + s = storage.WithStaticConnectors(s, storageConnectors) if len(c.OAuth2.ResponseTypes) > 0 {