Skip to content

Commit

Permalink
Merge pull request #7 from ixofoundation/develop
Browse files Browse the repository at this point in the history
feat: adding jambo authorization
  • Loading branch information
Michael-Ixo authored Sep 20, 2023
2 parents 57a23bf + c2d25e9 commit 8982071
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/auth.middleware.ts
Original file line number Diff line number Diff line change
@@ -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;
}
Expand Down

0 comments on commit 8982071

Please sign in to comment.