diff --git a/main.go b/main.go index 1dbb514bf43d6aa60ac2e3fb35a4408534d5fc63..1b205741d2c7d5c89363ff6666d4730f9dc28c99 100644 --- a/main.go +++ b/main.go @@ -17,7 +17,6 @@ import ( var ( httpPort = flag.Int("http_port", LookupEnvOrInt("HTTP_PORT", 80), "HTTP port to serve on (defaults to 80)") logLevel = flag.String("loglevel", LookupEnvOrString("LOGLEVEL", "debug"), "log level (debug, info, warning, error) (defaults to debug)") - proxyRedirectURI = flag.String("proxy_redirect_uri", LookupEnvOrString("PROXY_REDIRECT_URI", "https://oauth-proxy.wf.alpha.grandlyon.com/redirect"), "Proxy redirect URI (defaults to https://oauth-proxy.wf.alpha.grandlyon.com/redirect)") cozyDomain = flag.String("cozy_domain", LookupEnvOrString("COZY_DOMAIN", "cozy.wf.alpha.grandlyon.com"), "Cozy domain (defaults to cozy.wf.alpha.grandlyon.com)") cozyRedirectURI = flag.String("cozy_redirect_uri", LookupEnvOrString("COZY_REDIRECT_URI", "/accounts/enedis/redirect"), "Cozy redirect URI (defaults to /accounts/enedis/redirect)") ) @@ -115,7 +114,7 @@ func main() { // PROD API authURL := "https://mon-compte-particulier.enedis.fr/dataconnect/v1/oauth2/authorize" - redirectUrl := authURL + "?client_id=" + clientId + "&duration=P6M&redirect_uri=" + *proxyRedirectURI + "&response_type=" + responseType + "&state=" + state + "-" + instanceName + redirectUrl := authURL + "?client_id=" + clientId + "&duration=P6M&response_type=" + responseType + "&state=" + state + "-" + instanceName log.Debug("Redirect to - ", redirectUrl) http.Redirect(w, r, redirectUrl, 302)