"use strict";(()=>{vare={};e.id=2998,e.ids=[2998],e.modules={39908:e=>{e.exports=require("@moduletrace/datasquirel/dist/users/user-auth")},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")},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}}})},55896:(e,r,t)=>{t.r(r),t.d(r,{config:()=>m,default:()=>E,routeModule:()=>D});vars={};t.r(s),t.d(s,{default:()=>f});varn=t(89947),o=t(2706),i=t(96762),a=t(69842),c=t(29021),u=t.n(c),_=t(67619),l=t(48786),d=t(68829),p=t(89159);asyncfunctionS({userId:e,res:r,csrf:t}){try{lets=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!s)returnconsole.log("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable."),null;letn=await(0,l.A)("SELECT * FROM users WHERE id=?",[e]);u().unlinkSync(`${s}/${t}`);leto=Math.random().toString(36).substring(2)+"-"+Math.random().toString(36).substring(2),i={id:n[0].id,stripe_id:n[0].stripe_id||"",first_name:n[0].first_name,last_name:n[0].last_name,email:n[0].email,social_id:n[0].social_id,image:n[0].image,image_thumbnail:n[0].image_thumbnail,verification_status:n[0].verification_status,social_login:n[0].social_login,social_platform:n[0].social_platform,csrf_k:o,logged_in_status:!0,date:Date.now()},a=(0,d.A)({data:JSON.stringify(i)});u().writeFileSync(`${s}/${o}`,JSON.stringify(i));let{keyCookieName:c,csrfCookieName:_}=(0,p.A)();returnr.setHeader("Set-Cookie",[`${c}=${a};samesite=strict;path=/;HttpOnly=true;Secure=true`,`${_}=${o};samesite=strict;path=/;HttpOnly=true;Secure=true`,"user_refresh=1"]),i}catch(r){return(0,_.A)({component:"reAuthUser",message:r.message,user:{id:e}}),null}}asyncfunctionf(e,r){"POST"!==e.method&&r.json({msg:"Failed!"});lett=await(0,a.A)(e,r,!0);if(!t){console.log("No user Found"),r.redirect(307,"/logout");return}lets=awaitS({userId:t.id,res:r,csrf:t.csrf_k}),n={status:!!s,csrf:s?.csrf_k,user:s};r.json(n)}letE=(0,i.M)(s,"default"),m=(0,i.M)(s,"config"),D=newn.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/reAuthenticateUser",pathname:"/api/reAuthenticateUser",bundlePath:"",filename:""},userland:s})},69842:(e,r,t)=>{t.d(r,{A:()=>o});vars=t(39908),n=t.n(s);asyncfunctiono(e,r,t){lets=n()({req:e,level:t?"deep":void0});returnconsole.log(s),s.payload}},89159:(e,r,t)=>{t.d(r,{A:()=>s});functions(e){letr=process.env.DSQL_COOKIES_PREFIX||"dsql_",t=process.env.DSQL_COOKIES_KEY_NAME||"key",s=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",n=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",o=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),i=r;e?.userId&&(i+=`user_${e.userId}_`),o&&(i+=`${o}_`),i+=t;leta=r;e?.userId&&(a+=`user_${e.userId}_`),o&&(a+=`${o}_`),a+=s;letc=r;returne?.userId&&(c+=`user_${e.userId}_`),o&&(c+=`${o}_`),{keyCookieName:i,csrfCookieName:a,oneTimeCodeName:c+=n}}},67619:(e,r,t)=>{t.d(r,{A:()=>o});vars=t(29021),n=t.n(s);asyncfunctiono({user:e,message:r,component:t,noMail:s,req:o}){leti=newDate,a=(()=>{if(!o)returnnull;try{lete=o.headers["x-forwarded-for"],r=o.headers["x-real-ip"],t=o.headers["cf-connecting-ip"],s=Array.isArray(e)?e[0]:e?.split(",")[0],n=t||s||r||o.socket.remoteAddress;if(!n)returnnull;returnString(n)}catch(e){returnnull}})();try{lets=`🚀 SERVER ERROR ===========================