Handle HTTP/HTTPS protocol depending on dev env or not
This commit is contained in:
@@ -45,6 +45,7 @@ type OIDCHandler struct {
|
||||
NamespaceProviders map[string]fosite.OAuth2Provider
|
||||
config OIDCConfig
|
||||
handler handlers.MobilityAccountsHandler
|
||||
Protocol string //HTTP (dev env) or HTTPS
|
||||
PrivateKey *rsa.PrivateKey
|
||||
}
|
||||
|
||||
@@ -66,10 +67,16 @@ func NewOIDCHandler(h handlers.MobilityAccountsHandler, storage storage.Storage,
|
||||
providers[c.Namespace] = np
|
||||
}
|
||||
|
||||
protocol := "https"
|
||||
if config.GetBool("dev_env") {
|
||||
protocol = "http"
|
||||
}
|
||||
|
||||
return &OIDCHandler{
|
||||
config: oidc_config,
|
||||
handler: h,
|
||||
NamespaceProviders: providers,
|
||||
Protocol: protocol,
|
||||
PrivateKey: privateKey,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user