Skip to content

Commit

Permalink
Complain if the env set in SecretEnv cannot be found
Browse files Browse the repository at this point in the history
Signed-off-by: Sandro <[email protected]>
  • Loading branch information
SuperSandro2000 authored Dec 9, 2023
1 parent e41a28b commit f25f720
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/dex/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ func runServe(options serveOptions) error {
if client.Secret != "" {
return fmt.Errorf("invalid config: Secret and SecretEnv fields are exclusive for client %q", client.ID)
}
c.StaticClients[i].Secret = os.Getenv(client.SecretEnv)
secret := os.Getenv(client.SecretEnv)
if secret == "" {
return fmt.Errorf("invalid config: could not find SecretEnv %q", client.SecretEnv)
}
c.StaticClients[i].Secret = secret
}
logger.Infof("config static client: %s", client.Name)
}
Expand Down

0 comments on commit f25f720

Please sign in to comment.