TypeError: cks.get is not a function at getUserFromCookie (webpack-internal:///(sc_server)/./lib/auth.ts:37:21) at getData (webpack-internal:///(sc_server)/./components/Greetings.tsx:19:87) at Greetings (webpack-internal:///(sc_server)/./components/Greetings.tsx:24:24)
// Auth.ts
export const getUserFromCookie = async (cookies) => {
const jwt = cookies.get(process.env.COOKIE_NAME);
const { id } = await validateJWT(jwt.value);
const user = await db.user.findUnique({
where: {
id: id as string,
},
});
return user;
};
Getting this error
TypeError: cks.get is not a function at getUserFromCookie (webpack-internal:///(sc_server)/./lib/auth.ts:37:21) at getData (webpack-internal:///(sc_server)/./components/Greetings.tsx:19:87) at Greetings (webpack-internal:///(sc_server)/./components/Greetings.tsx:24:24)
package.json