"use strict";(()=>{var e={};e.id=8464,e.ids=[8464],e.modules={47795:e=>{e.exports=require("generate-password")},27825:e=>{e.exports=require("lodash")},75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},21572:e=>{e.exports=require("nodemailer")},72583:e=>{e.exports=require("sanitize-html")},9973:e=>{e.exports=require("serverless-mysql")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},81630:e=>{e.exports=require("http")},33873:e=>{e.exports=require("path")},62914:(e,r,a)=>{a.r(r),a.d(r,{config:()=>g,default:()=>f,routeModule:()=>q});var t={};a.r(t),a.d(t,{default:()=>m});var i=a(89947),s=a(2706),o=a(96762),l=a(20503),u=a.n(l),n=a(14385),p=a.n(n),d=a(31341),c=a.n(d);async function m(e,r){if("POST"!==e.method)return r.json({msg:"Failed!"});let{facebookUserId:a,facebookUserImage:t,facebookUserFullName:i,facebookUserFirstName:s,facebookUserLastName:o,facebookUserEmail:l,supEmail:n}=e.body,{invite:d}=e.query;try{let e=await p()({email:l,payload:{email:l,first_name:s,last_name:o,social_id:a,social_platform:"facebook",image:t,image_thumbnail:t,username:`facebook-user-${a}`},social_platform:"facebook",social_id:a,invitation:d,supEmail:n});if(e.payload?.csrf_k){let a=u()({data:JSON.stringify(e.payload)}),{keyCookieName:t,csrfCookieName:i}=c()();r.setHeader("Set-Cookie",[`${t}=${a};samesite=strict;path=/;HttpOnly=true;Secure=true`,`${i}=${e.payload.csrf_k};samesite=strict;path=/;HttpOnly=true`])}r.json(e)}catch(e){console.log(e.message),r.json({success:!1,msg:"Failed!"})}}let f=(0,o.M)(t,"default"),g=(0,o.M)(t,"config"),q=new i.PagesAPIRouteModule({definition:{kind:s.A.PAGES_API,page:"/api/social-login/facebook-auth",pathname:"/api/social-login/facebook-auth",bundlePath:"",filename:""},userland:t})}};var r=require("../../../webpack-api-runtime.js");r.C(e);var a=e=>r(r.s=e),t=r.X(0,[4050,4385],()=>a(62914));module.exports=t})();