From 852e0bfdc152faf1cebcb733c94223177447b53e Mon Sep 17 00:00:00 2001 From: kyrea Date: Mon, 5 Jun 2023 01:32:52 +0530 Subject: [PATCH] Fixed auth failed error --- package-lock.json | 4 ++-- package.json | 2 +- src/handlers/auth/index.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index de6afbc..6eacd30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "waifu.it", - "version": "3.4.11", + "version": "3.4.12", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "waifu.it", - "version": "3.4.11", + "version": "3.4.12", "license": "AGPLv3", "dependencies": { "chalk": "^4.1.1", diff --git a/package.json b/package.json index 47001b3..e469739 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "waifu.it", - "version": "3.4.11", + "version": "3.4.12", "description": "Random API Serving Anime stuff", "author": "Aeryk", "private": true, diff --git a/src/handlers/auth/index.js b/src/handlers/auth/index.js index bdeefe7..2dbe53f 100644 --- a/src/handlers/auth/index.js +++ b/src/handlers/auth/index.js @@ -5,10 +5,10 @@ const Stats = require('../../models/schemas/Stat') module.exports = async function authHandler(req, res, next) { try { // Request Header AUTH var - const { Authorization } = req.headers + const key = req.headers.authorization // Verifies if the {auth} exists in the database const userData = await Users.findOneAndUpdate( - { token: Authorization }, + { token: key }, { $inc: { req_quoto: -1, req_count: 1 } } )