From 0d5175b405897e81d480be27a3b4ee1bfbe57771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Mili=C4=87?= Date: Wed, 8 May 2024 16:55:30 +0200 Subject: [PATCH] docfix/Rename VITE_OBP_EXPLORER_HOST to VITE_OBP_API_EXPLORER_HOST --- .env.example | 3 ++- server/app.ts | 2 +- server/controllers/StatusController.ts | 2 +- server/controllers/UserController.ts | 2 +- server/middlewares/OauthAccessTokenMiddleware.ts | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 92ea235..d79e3ce 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,7 @@ VITE_OBP_API_HOST=https://apisandbox.openbankproject.com VITE_OBP_API_VERSION=v5.1.0 VITE_OBP_API_MANAGER_HOST=https://apimanagersandbox.openbankproject.com -VITE_OBP_EXPLORER_HOST=http://localhost:5173 +VITE_OBP_API_EXPLORER_HOST=http://localhost:5173 VITE_OBP_CONSUMER_KEY=your_consumer_key VITE_OBP_CONSUMER_SECRET=your_consumer_secret VITE_OBP_REDIRECT_URL=http://localhost:5173/api/callback @@ -9,6 +9,7 @@ VITE_OPB_SERVER_SESSION_PASSWORD=very secret # The above code connects to localhost on port 6379. # To connect to a different host or port, use a connection string in the format # redis[s]://[[username][:password]@][host][:port][/db-number] +# Be sure to secure your Redis instance VITE_OBP_REDIS_URL = redis://127.0.0.1:6379 # Product styling setting diff --git a/server/app.ts b/server/app.ts index 75f18da..786d80b 100644 --- a/server/app.ts +++ b/server/app.ts @@ -10,7 +10,7 @@ import path from 'path' const port = 8085 const app: Application = express() -const host = process.env.VITE_OBP_EXPLORER_HOST +const host = process.env.VITE_OBP_API_EXPLORER_HOST const httpsOrNot = host ? (host.indexOf('https://') == 0 ? true : false) : true // Initialize client. diff --git a/server/controllers/StatusController.ts b/server/controllers/StatusController.ts index 7dd7f49..c9c5e0c 100644 --- a/server/controllers/StatusController.ts +++ b/server/controllers/StatusController.ts @@ -8,7 +8,7 @@ import { OAuthConfig } from 'obp-typescript' @Service() @Controller('/status') export class StatusController { - private obpExplorerHome = process.env.VITE_OBP_EXPLORER_HOST + private obpExplorerHome = process.env.VITE_OBP_API_EXPLORER_HOST private connectors = [ 'kafka_vSept2018', 'akka_vDec2018', diff --git a/server/controllers/UserController.ts b/server/controllers/UserController.ts index bcd68b6..e296823 100644 --- a/server/controllers/UserController.ts +++ b/server/controllers/UserController.ts @@ -8,7 +8,7 @@ import superagent from 'superagent' @Service() @Controller('/user') export class UserController { - private obpExplorerHome = process.env.VITE_OBP_EXPLORER_HOST + private obpExplorerHome = process.env.VITE_OBP_API_EXPLORER_HOST constructor( private obpClientService: OBPClientService, private oauthInjectedService: OauthInjectedService diff --git a/server/middlewares/OauthAccessTokenMiddleware.ts b/server/middlewares/OauthAccessTokenMiddleware.ts index 9c561ee..d654b6f 100644 --- a/server/middlewares/OauthAccessTokenMiddleware.ts +++ b/server/middlewares/OauthAccessTokenMiddleware.ts @@ -36,7 +36,7 @@ export default class OauthAccessTokenMiddleware implements ExpressMiddlewareInte } session['clientConfig'] = clientConfig console.log('OauthAccessTokenMiddleware.ts use says: Seems OK, redirecting..') - response.redirect(`${process.env.VITE_OBP_EXPLORER_HOST}`) + response.redirect(`${process.env.VITE_OBP_API_EXPLORER_HOST}`) } } )