Fix req.body with JSON.parse()
This commit is contained in:
parent
15296f9163
commit
da9337a50b
3 changed files with 6 additions and 5 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue