From c2d25e90942d9edab83e57ac3fe1c8a311fe6ba4 Mon Sep 17 00:00:00 2001 From: Pieter Pretorius Date: Wed, 20 Sep 2023 12:33:21 +0200 Subject: [PATCH] feat: adding jambo authorization --- .env.example | 1 + src/auth.middleware.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 04d5ac3..89e825e 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ AUTHORIZATION="Bearer xvz1evFS4wEEPTGEFPHBog" +JAMBO_AUTHORIZATION="Bearer jmb1evFS4wEEPTGEFPHBog" RPC_URL="https://devnet.ixo.earth/rpc/" MNEMONIC="seven panther slogan boy midnight foam rib scale aim spare click grace" PORT=3000 diff --git a/src/auth.middleware.ts b/src/auth.middleware.ts index 34c996a..0fb782a 100644 --- a/src/auth.middleware.ts +++ b/src/auth.middleware.ts @@ -1,7 +1,10 @@ import { Request, Response, NextFunction } from 'express'; export function authorization(req: Request, res: Response, next: NextFunction) { - if (req.get('Authorization') !== process.env.AUTHORIZATION) { + if ( + req.get('Authorization') !== process.env.AUTHORIZATION && + req.get('Authorization') !== process.env.JAMBO_AUTHORIZATION + ) { res.send('Authorization Failed'); return; }