From a679a4405fcc1ae9331559b8bea1ebaa3d5791f4 Mon Sep 17 00:00:00 2001
From: Bastien DUMONT <bdumont@grandlyon.com>
Date: Thu, 30 Jun 2022 08:12:01 +0000
Subject: [PATCH] feat: bump consent duration to a year

---
 docker-compose.yml | 6 ++++++
 main.go            | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/docker-compose.yml b/docker-compose.yml
index a7486bb..4d80faf 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -2,6 +2,7 @@ version: "2.4"
 
 services:
   cozy-oauth-proxy:
+    #image: registry.forge.grandlyon.com/pocs/cozy/cozy-oauth-proxy:latest
     image: registry.forge.grandlyon.com/pocs/cozy/cozy-oauth-proxy
     # image: cozy-oauth-proxy
     container_name: cozy-oauth-proxy
@@ -13,3 +14,8 @@ services:
       - /etc/localtime:/etc/localtime:ro
     ports:
       - 8081:8081
+    logging:
+      driver: loki
+      options:
+        loki-url: http://localhost:3100/loki/api/v1/push
+
diff --git a/main.go b/main.go
index e4f2019..6f9e87b 100644
--- a/main.go
+++ b/main.go
@@ -231,7 +231,7 @@ func main() {
 				// authURL := "https://gw.hml.api.enedis.fr/dataconnect/v1/oauth2/authorize"
 				// PROD API
 				authURL := "https://mon-compte-particulier.enedis.fr/dataconnect/v1/oauth2/authorize"
-				redirectUrl := authURL + "?client_id=" + clientId + "&duration=P6M&response_type=" + responseType + "&state=" + state + "-" + instanceName
+				redirectUrl := authURL + "?client_id=" + clientId + "&duration=P12M&response_type=" + responseType + "&state=" + state + "-" + instanceName
 
 				log.Info("WL - EnedisSuccess - Authorize - Redirecting user to Enedis")
 				http.Redirect(w, r, redirectUrl, 302)
-- 
GitLab