Fix req.body with JSON.parse()

This commit is contained in:
aronmal 2023-02-13 23:21:38 +01:00
parent 15296f9163
commit da9337a50b
Signed by: aronmal
GPG key ID: 816B7707426FC612
3 changed files with 6 additions and 5 deletions

View file

@ -2,7 +2,7 @@ import { NextApiRequest } from "next"
async function getTokenFromBody<T>(payload: T & { req: NextApiRequest }) {
const { req } = payload
const token: string = req.body.token
const token: string = JSON.parse(req.body).token
// Checking for cookie presens, because it is necessary
if (!token) {