"use strict";(()=>{vare={};e.id=2998,e.ids=[2998],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},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")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){returnfunctione(r,t){returntinr?r[t]:"then"inr&&"function"==typeofr.then?r.then(r=>e(r,t)):"function"==typeofr&&"default"===t?r:void0}}})},96499:(e,r,t)=>{t.r(r),t.d(r,{config:()=>_,default:()=>f,routeModule:()=>d});vars={};t.r(s),t.d(s,{default:()=>p});varn=t(89947),i=t(2706),a=t(96762),o=t(6420),l=t.n(o),u=t(56129),c=t.n(u);asyncfunctionp(e,r){"POST"!==e.method&&r.json({msg:"Failed!"});lett=awaitl()(e,r,!0);if(!t){console.log("No user Found"),r.redirect(307,"/logout");return}lets=awaitc()({userId:t.id,res:r,csrf:t.csrf_k}),n={status:!!s,csrf:s?.csrf_k,user:s};r.json(n)}letf=(0,a.M)(s,"default"),_=(0,a.M)(s,"config"),d=newn.PagesAPIRouteModule({definition:{kind:i.A.PAGES_API,page:"/api/reAuthenticateUser",pathname:"/api/reAuthenticateUser",bundlePath:"",filename:""},userland:s})},56129:(e,r,t)=>{lets=t(29021),n=t(77538),{ServerResponse:i}=t(81630),a=t(51348),o=t(82703);e.exports=asyncfunction({userId:e,res:r,csrf:t}){try{letn=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!n)returnconsole.log("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable."),null;leti=awaita("SELECT * FROM users WHERE id=?",[e]);s.unlinkSync(`${n}/${t}`);letl=Math.random().toString(36).substring(2)+"-"+Math.random().toString(36).substring(2),u={id:i[0].id,stripe_id:i[0].stripe_id||"",first_name:i[0].first_name,last_name:i[0].last_name,email:i[0].email,social_id:i[0].social_id,image:i[0].image,image_thumbnail:i[0].image_thumbnail,verification_status:i[0].verification_status,social_login:i[0].social_login,social_platform:i[0].social_platform,csrf_k:l,logged_in_status:!0,date:Date.now()},c=o(JSON.stringify(u));returns.writeFileSync(`${n}/${l}`,JSON.stringify(u)),r.setHeader("Set-Cookie",[`datasquirelAuthKey=${c};samesite=strict;path=/;HttpOnly=true;Secure=true`,`csrf=${l};samesite=strict;path=/;HttpOnly=true;Secure=true`,"user_refresh=1"]),u}catch(r){returnn({component:"reAuthUser",message:r.message,user:{id:e}}),null}}},77538:(e,r,t)=>{lets=t(29021),{IncomingMessage:n}=t(81630);e.exports=asyncfunction({user:e,message:r,component:t,noMail:n,req:i}){leta=newDate,o=(()=>{if(!i)returnnull;try{lete=i.headers["x-forwarded-for"],r=i.headers["x-real-ip"],t=i.headers["cf-connecting-ip"],s=Array.isArray(e)?e[0]:e?.split(",")[0],n=t||s||r||i.socket.remoteAddress;if(!n)returnnull;returnString(n)}catch(e){returnnull}})();try{letn=`🚀 SERVER ERROR ===========================