This makes a call to `update...
# support-questions-legacy
s
This makes a call to
updateInfo(user.id, { first_name, last_name });
Where I have this in my updateInfo file. Based on what I understood from the docs. https://supertokens.com/docs/emailpassword/common-customizations/usermetadata/store-data
Copy code
import { superTokensNextWrapper } from "supertokens-node/nextjs";
import { verifySession } from "supertokens-node/recipe/session/framework/express";
import { SessionRequest } from "supertokens-node/framework/express";
import UserMetadata from "supertokens-node/recipe/usermetadata";

export default async function updateInfo(req: any, res: any) {
  console.log("req.body")
  console.log(req.body)
  await superTokensNextWrapper(
    async (next) => {
      await verifySession()(req, res, next);
    },
    req,
    res,
  );

  const session = (req as SessionRequest).session;
  const userId = session!.getUserId();

  await UserMetadata.updateUserMetadata(userId, { newKey: "data" });
  res.json({ message: "successfully updated user metadata" });
}
8 Views