2025-01-14 06:10:36 +00:00
|
|
|
"use strict";(()=>{var e={};e.id=6712,e.ids=[3220,6712],e.modules={30671:(e,t)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){return function e(t,r){return r in t?t[r]:"then"in t&&"function"==typeof t.then?t.then(t=>e(t,r)):"function"==typeof t&&"default"===r?t:void 0}}})},70852:(e,t,r)=>{r.r(t),r.d(t,{config:()=>A,default:()=>E,getServerSideProps:()=>P,getStaticPaths:()=>j,getStaticProps:()=>v,reportWebVitals:()=>b,routeModule:()=>I,unstable_getServerProps:()=>O,unstable_getServerSideProps:()=>w,unstable_getStaticParams:()=>k,unstable_getStaticPaths:()=>D,unstable_getStaticProps:()=>N});var s={};r.r(s),r.d(s,{default:()=>_,getServerSideProps:()=>y});var n=r(63865),i=r(9455),a=r(30671),o=r(5583),l=r(19796),c=r(8732),u=r(82015),d=r.n(u),m=r(92702),p=r(16757),f=r(46169),g=r(71205),h=r(1013),S=r(77047),x=r(71934);function _({user:e,verified:t}){let[r,s]=d().useState(!1),[n,i]=d().useState(null);return t?(0,c.jsx)(h.A,{head:(0,c.jsxs)(d().Fragment,{children:[(0,c.jsx)("title",{children:"Verify Email Address"}),(0,c.jsx)("meta",{name:"description",content:"Verify your email address"})]}),user:e,children:(0,c.jsx)("main",{className:"flex items-center justify-center w-full p-8",children:(0,c.jsx)("div",{className:"login-block gap-2",children:(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsx)("img",{src:"/images/checkmark.svg",alt:"check-mark",width:30}),(0,c.jsx)("span",{className:"text-xl",children:"Email Verification Successfull!"})]})})})}):(0,c.jsx)(d().Fragment,{children:(0,c.jsx)(h.A,{head:(0,c.jsxs)(d().Fragment,{children:[(0,c.jsx)("title",{children:"Verify Email Address"}),(0,c.jsx)("meta",{name:"description",content:"Verify your email address"})]}),user:e,children:(0,c.jsx)("main",{className:"flex flex-col items-center p-8 justify-center w-full",children:(0,c.jsxs)("div",{className:"login-block gap-2 flex-col max-w-lg",children:[n&&(0,c.jsx)("div",{className:n.class+" w-full rounded py-2 px-4 flex justify-center",children:n.msg}),r&&(0,c.jsx)(p.A,{position:"absolute"}),(0,c.jsx)("h1",{className:"text-2xl m-0 ",children:"Verify Email Address"}),(0,c.jsx)("span",{children:"Please click the button below to send verification link"}),(0,c.jsx)("button",{className:"w-full",onClick:function(e){e.preventDefault(),s(!0),(0,f.A)("/api/sendEmailVerificationLink").then(e=>{s(!1),e.success&&i({msg:"Email Sent. Please check mailbox",class:"bg-emerald-100"})})},children:(0,c.jsx)("span",{children:"Send Verification Link"})}),(0,c.jsx)("button",{className:"w-full outlined",onClick:e=>{window.history.back()},children:(0,c.jsx)("span",{children:"Go Back"})})]})})})})}async function y({req:e,res:t,query:r}){let s;let n=!1;try{s=await (0,m.A)(e,t);let i=r?.token;if(i){let e=(0,g.A)({encryptedString:i.toString()});if(e)try{s=JSON.parse(e)}catch(e){(0,S.A)({component:"email-verification/index-page-component/getServerSideProps/line-255",message:e.message,user:{}}),s=null,i=null}}if(!s)return{redirect:{destination:"/logout",permanent:!1}};if(s.verification_status?.toString().match(/^[1-5]$/))return{redirect:{destination:"/admin",permanent:!1}};let a=await (0,x.A)(`SELECT id FROM users WHERE verification_status > 0 AND id='${s.id}'`);if(a&&a[0])return{redirect:{destination:"/admin",permanent:!1}};if(s?.dateCode){let e=s.dateCode;Date.now()-parseInt(e)>18e5?(s=null,i=null):(await (0,x.A)(`UPDATE users SET verification_status='1' WHERE id='${s.id}'`),n=!0)}}catch(e){return(0,S.A)({component:"email-verification/index-page-component/getServerSideProps/main-catch-error",message:e.message,user:{}}),{redirect:{destination:"/logout",permanent:!1}}}return{props:{user:s,verified:n}}}let E=(0,a.M)(s,"default"),v=(0,a.M)(s,"getStaticProps"),j=(0,a.M)(s,"getStaticPaths"),P=(0,a.M)(s,"getServerSideProps"),A=(0,a.M)(s,"config"),b=(0,a.M)(s,"reportWebVitals"),N=(0,a.M)(s,"unstable_getStaticProps"),D=(0,a.M)(s,"unstable_getStaticPaths"),k=(0,a.M)(s,"unstable_getStaticParams"),O=(0,a.M)(s,"unstable_getServerProps"),w=(0,a.M)(s,"unstable_getServerSideProps"),I=new n.PagesRouteModule({definition:{kind:i.A.PAGES,page:"/email-v
|
2024-12-08 19:56:57 +00:00
|
|
|
Error Message: ${t}
|
2025-01-13 08:00:21 +00:00
|
|
|
Component: ${r}`;e?.id&&e?.first_name&&e?.last_name&&e?.email&&(s+=`
|
2024-12-08 19:56:57 +00:00
|
|
|
User Id: ${e?.id}
|
|
|
|
User Name: ${e?.first_name} ${e?.last_name}
|
2025-01-13 08:00:21 +00:00
|
|
|
User Email: ${e?.email}`),i?.url&&(s+=`
|
|
|
|
URL: ${i.url}`),i?.body&&(s+=`
|
2025-01-14 06:10:36 +00:00
|
|
|
Request Body: ${JSON.stringify(i.body,null,4)}`),o&&(s+=`
|
|
|
|
IP: ${o}`),s+=`
|
2024-12-08 19:56:57 +00:00
|
|
|
Date: ${a.toDateString()}
|
2025-01-14 06:10:36 +00:00
|
|
|
========================================`,n().existsSync("./.tmp/error.log")||n().writeFileSync("./.tmp/error.log","","utf-8");let l=n().readFileSync("./.tmp/error.log","utf-8");n().writeFileSync("./.tmp/error.log",s),n().appendFileSync("./.tmp/error.log",`
|
2024-12-08 19:56:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-14 06:10:36 +00:00
|
|
|
${l}`)}catch(e){console.log("Server Error Reporting Error:",e.message)}}},71205:(e,t,r)=>{r.d(t,{A:()=>i});var s=r(55511),n=r(79428);function i({encryptedString:e,encryptionKey:t,encryptionSalt:r}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let i=t||process.env.DSQL_ENCRYPTION_PASSWORD,a=r||process.env.DSQL_ENCRYPTION_SALT,o=process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24;if(!i?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!a?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let l=(0,s.scryptSync)(i,a,o),c=n.Buffer.alloc(16,0),u=(0,s.createDecipheriv)("aes-192-cbc",l,c);try{let t=u.update(e,"hex","utf8");return t+=u.final("utf8")}catch(t){return console.log("Error in decrypting =>",t.message),e}}},71934:(e,t,r)=>{r.d(t,{A:()=>s});async function s(...e){let t=global.DSQL_DB_CONN;try{if(!t)throw Error("No Connection provided to DB_HANDLER function!");let r=await t.query(...e);return JSON.parse(JSON.stringify(r))}catch(e){return console.log("DB Error =>",e),{success:!1,error:e.message}}finally{await t?.end()}}},5583:(e,t,r)=>{r.r(t),r.d(t,{default:()=>i});var s=r(8732);r(82015);var n=r(20883);function i(){return(0,s.jsxs)(n.Html,{lang:"en",children:[(0,s.jsxs)(n.Head,{children:[(0,s.jsx)("meta",{name:"author",content:"Datasquirel"}),(0,s.jsx)("meta",{name:"Copyright",content:`Copyright (c) ${new Date().getFullYear()} Datasquirel`}),"dev_dev".match(/dev/)&&(0,s.jsx)("meta",{name:"robots",content:"noindex,nofollow"}),(0,s.jsx)("link",{rel:"preconnect",href:"https://fonts.googleapis.com/",crossOrigin:"anonymous"}),(0,s.jsx)("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),(0,s.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Poppins"}),(0,s.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Inter"}),(0,s.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=IBM+Plex+Mono"}),(0,s.jsx)("script",{src:"/scripts/themeSelector.js"}),(0,s.jsx)("meta",{httpEquiv:"Content-Type",content:"text/html; charset=UTF-8"}),(0,s.jsx)("meta",{property:"og:site_name",content:"DATASQUIREL"}),(0,s.jsx)("meta",{property:"og:type",content:"website"}),(0,s.jsx)("meta",{name:"twitter:card",content:"summary"}),(0,s.jsx)("meta",{property:"og:image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,s.jsx)("meta",{itemProp:"image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,s.jsx)("meta",{name:"twitter:image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,s.jsx)("link",{rel:"stylesheet",href:"/styles/prism.css"}),(0,s.jsx)("script",{src:"/scripts/prism.js",async:!0}),(0,s.jsx)("script",{dangerouslySetInnerHTML:{__html:"var DSQL = {}"}})]}),(0,s.jsxs)("body",{children:[(0,s.jsx)(n.Main,{}),(0,s.jsx)(n.NextScript,{})]})]})}},9455:(e,t)=>{Object.defineProperty(t,"A",{enumerable:!0,get:function(){return r}});var r=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}({})},13893:e=>{e.exports=require("@moduletrace/datasquirel/dist/client/fetch")},40361:e=>{e.exports=require("next/dist/compiled/next-server/pages.runtime.prod.js")},27912:e=>{e.exports=require("next/head")},82015:e=>{e.exports=require("react")},22326:e=>{e.exports=require("react-dom")},8732:e=>{e.exports=require("react/jsx-runtime")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},33873:e=>{e.exports=require("path")}};var t=require("../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[883,9821,9796],()=>r(70852));module.exports=s})();
|