"use strict";(()=>{var e={};e.id=3303,e.ids=[3303],e.modules={28187:e=>{e.exports=require("@moduletrace/datasquirel")},75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},29021:e=>{e.exports=require("fs")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,t){return t in r?r[t]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,t)):"function"==typeof r&&"default"===t?r:void 0}}})},19813:(e,r,t)=>{t.r(r),t.d(r,{config:()=>p,default:()=>c,routeModule:()=>g});var n={};t.r(n),t.d(n,{default:()=>d});var o=t(89947),s=t(2706),a=t(96762),i=t(67619),l=t(28187),u=t.n(l);async function d(e,r){if("POST"===e.method)try{let{paradigm:t,token:n,email:o,oneTimeCode:s,password:a}=e.body;if("google"==t&&n){if(process.env.DISABLE_NEW_USER_SIGNUP)throw Error("Signup not Allowed!");let e=await u().user.social.loginWithGoogle({token:n,response:r});if(!e?.payload?.logged_in_status)return r.json({success:!1,msg:"Login failed!",payload:null});return r.json(e)}let i=await u().user.loginUser({database:"datasquirel",payload:{email:o,username:o,password:a},response:r});return r.json(i)}catch(e){console.log("Login Error =>",e.message),(0,i.A)({component:"/api/loginUser/main-catch-error",message:e.message})}else r.json({success:!1,msg:"Oops ..."})}let c=(0,a.M)(n,"default"),p=(0,a.M)(n,"config"),g=new o.PagesAPIRouteModule({definition:{kind:s.A.PAGES_API,page:"/api/loginUser",pathname:"/api/loginUser",bundlePath:"",filename:""},userland:n})},67619:(e,r,t)=>{t.d(r,{A:()=>s});var n=t(29021),o=t.n(n);async function s({user:e,message:r,component:t,noMail:n,req:s}){let a=new Date,i=(()=>{if(!s)return null;try{let e=s.headers["x-forwarded-for"],r=s.headers["x-real-ip"],t=s.headers["cf-connecting-ip"],n=Array.isArray(e)?e[0]:e?.split(",")[0],o=t||n||r||s.socket.remoteAddress;if(!o)return null;return String(o)}catch(e){return null}})();try{let n=`🚀 SERVER ERROR ===========================
Error Message: ${r}
Component: ${t}`;e?.id&&e?.first_name&&e?.last_name&&e?.email&&(n+=`
User Id: ${e?.id}
User Name: ${e?.first_name} ${e?.last_name}
User Email: ${e?.email}`),s?.url&&(n+=`
URL: ${s.url}`),s?.body&&(n+=`
Request Body: ${JSON.stringify(s.body,null,4)}`),i&&(n+=`
IP: ${i}`),n+=`
Date: ${a.toDateString()}
========================================`,o().existsSync("./.tmp/error.log")||o().writeFileSync("./.tmp/error.log","","utf-8");let l=o().readFileSync("./.tmp/error.log","utf-8");o().writeFileSync("./.tmp/error.log",n),o().appendFileSync("./.tmp/error.log",`




${l}`)}catch(e){console.log("Server Error Reporting Error:",e.message)}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return t}});var t=function(e){return e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE",e}({})},89947:(e,r,t)=>{e.exports=t(75600)}};var r=require("../../webpack-api-runtime.js");r.C(e);var t=r(r.s=19813);module.exports=t})();