Is there a way to compare the value of req.query
with the cookies on the site, even when req.query
is undefined upon initial load? How can this be addressed?
export default async function handler(req, res) {
const { method } = req;
const userId = req.query.id; //undefined
const userCookieId = req.cookies?.uid || req.cookies?.guestId; //undefined
const authUser = userId === userCookieId;
}