Skip to content

Commit

Permalink
Merge pull request #47 from WaifuAPI/staging
Browse files Browse the repository at this point in the history
Fixed authorization failed error
  • Loading branch information
kyrea authored Jun 4, 2023
2 parents a107c69 + 852e0bf commit 1bb71ce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 } }
)

Expand Down

0 comments on commit 1bb71ce

Please sign in to comment.