sdy

update jwt_secret value

import jwt from "jsonwebtoken";
import { PrismaClient } from "@prisma/client";
export const APP_SECRET = "a"; // TODO : value update to object
export const prisma = new PrismaClient();
export const getUserId = (context) => {
const Authorization = context.request.get("Authorization");
if (Authorization) {
const token = Authorization.replace("Bearer ", "");
const { userId } = jwt.verify(token, APP_SECRET);
const { userId } = jwt.verify(token, process.env.JWT_SECRET);
return userId;
}
throw new Error("There is no vaild user");
......