Commit dc4b97b8 authored by rithu john's avatar rithu john

cmd/dex/serve: add local connector directly to static connectors in storage

parent 951fb053
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment