From 7046b83e29f32f35f8a64554f3dbc9d7a105c783 Mon Sep 17 00:00:00 2001 From: Sadrinho27 Date: Fri, 12 Sep 2025 12:20:51 +0200 Subject: [PATCH] Removed hardcoded values for idnot config & updated .env file --- .env.exemple | 6 ++++++ src/config/idnot.ts | 12 ++++++------ src/config/index.ts | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.env.exemple b/.env.exemple index 8747399..39c9922 100644 --- a/.env.exemple +++ b/.env.exemple @@ -1,6 +1,11 @@ # Configuration IDNOT IDNOT_ANNUARY_BASE_URL= IDNOT_API_KEY= +IDNOT_CLIENT_ID= +IDNOT_CLIENT_SECRET= +IDNOT_REDIRECT_URI= +IDNOT_TOKEN_URL= +IDNOT_API_BASE_URL= # Configuration OVH OVH_APP_KEY= @@ -30,5 +35,6 @@ DECLINED= 4000 0025 0000 3155 #Paiement refusé # Configuration serveur APP_HOST= +PORT= API_BASE_URL= DEFAULT_STORAGE= diff --git a/src/config/idnot.ts b/src/config/idnot.ts index 1642586..d729bb2 100644 --- a/src/config/idnot.ts +++ b/src/config/idnot.ts @@ -3,11 +3,11 @@ export const idnotConfig = { IDNOT_ANNUARY_BASE_URL: process.env.IDNOT_ANNUARY_BASE_URL, // OAuth2 credentials (these should ideally be moved to env vars for security) - CLIENT_ID: 'B3CE56353EDB15A9', - CLIENT_SECRET: '3F733549E879878344B6C949B366BB5CDBB2DB5B7F7AB7EBBEBB0F0DD0776D1C', - REDIRECT_URI: 'http://local.4nkweb.com:3000/authorized-client', - + CLIENT_ID: process.env.IDNOT_CLIENT_ID, + CLIENT_SECRET: process.env.IDNOT_CLIENT_SECRET, + REDIRECT_URI: process.env.IDNOT_REDIRECT_URI, + // API URLs - TOKEN_URL: 'https://qual-connexion.idnot.fr/user/IdPOAuth2/token/idnot_idp_v1', - API_BASE_URL: 'https://qual-api.notaires.fr/annuaire' + TOKEN_URL: process.env.IDNOT_TOKEN_URL, + API_BASE_URL: process.env.IDNOT_API_BASE_URL }; diff --git a/src/config/index.ts b/src/config/index.ts index 96aae65..06a474c 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -3,7 +3,7 @@ import * as dotenv from 'dotenv'; dotenv.config(); export const config = { - port: process.env.PORT || 8080, + port: process.env.PORT, defaultStorage: process.env.DEFAULT_STORAGE, appHost: process.env.APP_HOST,