Skip to content

Commit

Permalink
Merge branch 'dev' into 'master'
Browse files Browse the repository at this point in the history
Dev

See merge request ergo/rosen-bridge/watcher!245
  • Loading branch information
vorujack committed Feb 22, 2024
2 parents 2e67822 + 85d04e8 commit 7de7968
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { getConfig } from '../config/config';
import { uint8ArrayToHex } from '../utils/utils';

const authenticateKey = (req: Request, res: Response, next: NextFunction) => {
const api_key: string = req.header('API_KEY')!;
const api_key: string = req.header('Api-Key')!;
if (
api_key &&
uint8ArrayToHex(blake2b(api_key, undefined, 32)) ==
getConfig().general.apiKeyHash
) {
next();
} else {
res.status(403).send({ message: "API_KEY doesn't exist or it is wrong" });
res.status(403).send({ message: "Api-Key doesn't exist or it is wrong" });
}
};

Expand Down

0 comments on commit 7de7968

Please sign in to comment.