import hashPassword from '@/lib/hashPassword' ; import { getSession , withApiAuthRequired , UserProfile , } from '@auth0/nextjs-auth0' ; import { NextApiRequest , NextApiResponse } from 'next' ; import addHarperDbRecord from 'utils/addHarperDbRecord' ; async function fetchSitesApi ( req , res ) { const { user } = getSession ( req , res ) ; req . body = JSON . parse ( req . body ) ; const data = await addHarperDbRecord ( req . body . record , user . sub ) ; res . json ( data ) ; } export default withApiAuthRequired ( fetchSitesApi ) ;