From 51bf2534b87d1398202e8ec85410b1d21a95dd60 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Fri, 15 Nov 2024 18:35:49 +0300 Subject: [PATCH] use a single bearer token --- .env.example | 3 +-- config/config.go | 10 ++++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.env.example b/.env.example index d392c9b..c636fa8 100644 --- a/.env.example +++ b/.env.example @@ -16,6 +16,5 @@ DB_TIMEZONE=Africa/Nairobi #External API Calls CUSTODIAL_URL_BASE=http://localhost:5003 -CUSTODIAL_BEARER_TOKEN=eyJeSIsInRcCI6IkpXVCJ.yJwdWJsaWNLZXkiOiIwrrrrrr +BEARER_TOKEN=eyJeSIsInRcCI6IkpXVCJ.yJwdWJsaWNLZXkiOiIwrrrrrr DATA_URL_BASE=http://localhost:5006 -DATA_BEARER_TOKEN=eyJeSIsIRcCI6IXVCJ.yJwdWJsaLZXkiOiIwrrrrrr diff --git a/config/config.go b/config/config.go index 0d39e6e..edb33fe 100644 --- a/config/config.go +++ b/config/config.go @@ -18,10 +18,9 @@ const ( ) var ( - custodialURLBase string - dataURLBase string - CustodialBearerToken string - DataBearerToken string + custodialURLBase string + dataURLBase string + BearerToken string ) var ( @@ -40,8 +39,7 @@ func setBase() error { custodialURLBase = initializers.GetEnv("CUSTODIAL_URL_BASE", "http://localhost:5003") dataURLBase = initializers.GetEnv("DATA_URL_BASE", "http://localhost:5006") - CustodialBearerToken = initializers.GetEnv("CUSTODIAL_BEARER_TOKEN", "") - DataBearerToken = initializers.GetEnv("DATA_BEARER_TOKEN", "") + BearerToken = initializers.GetEnv("BEARER_TOKEN", "") _, err = url.JoinPath(custodialURLBase, "/foo") if err != nil {