Skip to content

Commit 1bb71ce

Browse files
authored
Merge pull request #47 from WaifuAPI/staging
Fixed authorization failed error
2 parents a107c69 + 852e0bf commit 1bb71ce

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "waifu.it",
3-
"version": "3.4.11",
3+
"version": "3.4.12",
44
"description": "Random API Serving Anime stuff",
55
"author": "Aeryk",
66
"private": true,

src/handlers/auth/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ const Stats = require('../../models/schemas/Stat')
55
module.exports = async function authHandler(req, res, next) {
66
try {
77
// Request Header AUTH var
8-
const { Authorization } = req.headers
8+
const key = req.headers.authorization
99
// Verifies if the {auth} exists in the database
1010
const userData = await Users.findOneAndUpdate(
11-
{ token: Authorization },
11+
{ token: key },
1212
{ $inc: { req_quoto: -1, req_count: 1 } }
1313
)
1414

0 commit comments

Comments
 (0)