This commit is contained in:
Alex Ant
2024-10-10 21:43:09 +05:00
parent 301ce36517
commit 08ce652c8f
+2 -2
View File
@@ -34,7 +34,7 @@ app.post('/withdraw', async (req: Request, res: Response) => {
const authHeader = req.headers.authorization;
// Проверка на наличие и соответствие заголовка Authorization
if (!authHeader || authHeader !== `Bearer ${process.env.SECRET}`) {
if (!authHeader || authHeader !== `${process.env.SECRET}`) {
console.log('on auth error', authHeader)
return res.status(403).json({ error: 'Forbidden: Invalid or missing Authorization header' });
}
@@ -62,7 +62,7 @@ app.post('/contribution', async (req: Request, res: Response) => {
const authHeader = req.headers.authorization;
// Проверка на наличие и соответствие заголовка Authorization
if (!authHeader || authHeader !== `Authorization ${process.env.SECRET}`) {
if (!authHeader || authHeader !== `${process.env.SECRET}`) {
console.log('on auth error')
return res.status(403).json({ error: 'Forbidden: Invalid or missing Authorization header' });
}