From 6de1e1823f1d83d7c3927a04ce6b1daf94cfec3a Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Wed, 5 Jun 2024 15:24:30 +0300 Subject: [PATCH] apps/api: pass creds for TELEGRAM_URL_SEND_AUTH_MESSAGE --- apps/api/src/config/schema/env.ts | 2 ++ apps/api/src/ldap-tfa/ldap-tfa.controller.ts | 4 ++++ docker-compose.yml | 2 ++ 3 files changed, 8 insertions(+) diff --git a/apps/api/src/config/schema/env.ts b/apps/api/src/config/schema/env.ts index 2ba1236..056fa75 100644 --- a/apps/api/src/config/schema/env.ts +++ b/apps/api/src/config/schema/env.ts @@ -27,7 +27,9 @@ const envSchema = z.object({ .string() .transform((val) => Number.parseInt(val, 10)) .default('6379'), + TELEGRAM_URL_SEND_AUTH_LOGIN: z.string(), TELEGRAM_URL_SEND_AUTH_MESSAGE: z.string(), + TELEGRAM_URL_SEND_AUTH_PASSWORD: z.string(), }); export default envSchema; diff --git a/apps/api/src/ldap-tfa/ldap-tfa.controller.ts b/apps/api/src/ldap-tfa/ldap-tfa.controller.ts index dd9c064..c9004c4 100644 --- a/apps/api/src/ldap-tfa/ldap-tfa.controller.ts +++ b/apps/api/src/ldap-tfa/ldap-tfa.controller.ts @@ -69,6 +69,10 @@ export class LdapTfaController extends LdapController { return axios .get(env.TELEGRAM_URL_SEND_AUTH_MESSAGE, { + auth: { + password: env.TELEGRAM_URL_SEND_AUTH_PASSWORD, + username: env.TELEGRAM_URL_SEND_AUTH_LOGIN, + }, params: { authId, employeeID, diff --git a/docker-compose.yml b/docker-compose.yml index 116d869..fd2e25c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,6 +28,8 @@ services: - REDIS_HOST=redis - MONGO_HOST=mongo - TELEGRAM_URL_SEND_AUTH_MESSAGE=${TELEGRAM_URL_SEND_AUTH_MESSAGE} + - TELEGRAM_URL_SEND_AUTH_LOGIN=${TELEGRAM_URL_SEND_AUTH_LOGIN} + - TELEGRAM_URL_SEND_AUTH_PASSWORD=${TELEGRAM_URL_SEND_AUTH_PASSWORD} restart: always networks: - auth_network