2025-02-19 19:38:56 +00:00
|
|
|
"use strict";(()=>{var e={};e.id=6712,e.ids=[3220,6712],e.modules={30671:(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}}})},70852:(e,r,t)=>{t.r(r),t.d(r,{config:()=>A,default:()=>E,getServerSideProps:()=>y,getStaticPaths:()=>L,getStaticProps:()=>x,reportWebVitals:()=>N,routeModule:()=>Q,unstable_getServerProps:()=>j,unstable_getServerSideProps:()=>R,unstable_getStaticParams:()=>b,unstable_getStaticPaths:()=>O,unstable_getStaticProps:()=>P});var s={};t.r(s),t.d(s,{default:()=>h,getServerSideProps:()=>v});var n=t(63865),a=t(9455),i=t(30671),o=t(5583),c=t(53881),l=t(8732),u=t(82015),p=t.n(u),d=t(92702),m=t(16757),_=t(46169),S=t(71205),f=t(26228),g=t(77047),D=t(71934);function h({user:e,verified:r}){let[t,s]=p().useState(!1),[n,a]=p().useState(null);return r?(0,l.jsx)(f.A,{head:(0,l.jsxs)(p().Fragment,{children:[(0,l.jsx)("title",{children:"Verify Email Address"}),(0,l.jsx)("meta",{name:"description",content:"Verify your email address"})]}),user:e,children:(0,l.jsx)("main",{className:"flex items-center justify-center w-full p-8",children:(0,l.jsx)("div",{className:"login-block gap-2",children:(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)("img",{src:"/images/checkmark.svg",alt:"check-mark",width:30}),(0,l.jsx)("span",{className:"text-xl",children:"Email Verification Successfull!"})]})})})}):(0,l.jsx)(p().Fragment,{children:(0,l.jsx)(f.A,{head:(0,l.jsxs)(p().Fragment,{children:[(0,l.jsx)("title",{children:"Verify Email Address"}),(0,l.jsx)("meta",{name:"description",content:"Verify your email address"})]}),user:e,children:(0,l.jsx)("main",{className:"flex flex-col items-center p-8 justify-center w-full",children:(0,l.jsxs)("div",{className:"login-block gap-2 flex-col max-w-lg",children:[n&&(0,l.jsx)("div",{className:n.class+" w-full rounded py-2 px-4 flex justify-center",children:n.msg}),t&&(0,l.jsx)(m.A,{position:"absolute"}),(0,l.jsx)("h1",{className:"text-2xl m-0 ",children:"Verify Email Address"}),(0,l.jsx)("span",{children:"Please click the button below to send verification link"}),(0,l.jsx)("button",{className:"w-full",onClick:function(e){e.preventDefault(),s(!0),(0,_.A)("/api/sendEmailVerificationLink").then(e=>{s(!1),e.success&&a({msg:"Email Sent. Please check mailbox",class:"bg-emerald-100"})})},children:(0,l.jsx)("span",{children:"Send Verification Link"})}),(0,l.jsx)("button",{className:"w-full outlined",onClick:e=>{window.history.back()},children:(0,l.jsx)("span",{children:"Go Back"})})]})})})})}async function v({req:e,res:r,query:t}){let s;let n=!1;try{s=await (0,d.A)(e,r);let a=t?.token;if(a){let e=(0,S.A)({encryptedString:a.toString()});if(e)try{s=JSON.parse(e)}catch(e){(0,g.A)({component:"email-verification/index-page-component/getServerSideProps/line-255",message:e.message,user:{}}),s=null,a=null}}if(!s)return{redirect:{destination:"/logout",permanent:!1}};if(s.verification_status?.toString().match(/^[1-5]$/))return{redirect:{destination:"/admin",permanent:!1}};let i=await (0,D.A)(`SELECT id FROM users WHERE verification_status > 0 AND id='${s.id}'`);if(i&&i[0])return{redirect:{destination:"/admin",permanent:!1}};if(s?.dateCode){let e=s.dateCode;Date.now()-parseInt(e)>18e5?(s=null,a=null):(await (0,D.A)(`UPDATE users SET verification_status='1' WHERE id='${s.id}'`),n=!0)}}catch(e){return(0,g.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,i.M)(s,"default"),x=(0,i.M)(s,"getStaticProps"),L=(0,i.M)(s,"getStaticPaths"),y=(0,i.M)(s,"getServerSideProps"),A=(0,i.M)(s,"config"),N=(0,i.M)(s,"reportWebVitals"),P=(0,i.M)(s,"unstable_getStaticProps"),O=(0,i.M)(s,"unstable_getStaticPaths"),b=(0,i.M)(s,"unstable_getStaticParams"),j=(0,i.M)(s,"unstable_getServerProps"),R=(0,i.M)(s,"unstable_getServerSideProps"),Q=new n.PagesRouteModule({definition:{kind:a.A.PAGES,page:"/email-
|
2025-02-19 19:38:56 +00:00
|
|
|
${c}`)}catch(e){console.log("Server Error Reporting Error:",e.message)}}},71205:(e,r,t)=>{t.d(r,{A:()=>i});var s=t(55511),n=t(79428),a=t(48243);function i({encryptedString:e,encryptionKey:r,encryptionSalt:t}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let{key:i,salt:o,keyLen:c,algorithm:l,bufferAllocSize:u}=(0,a.A)({encryptionKey:r});if(!i?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!o?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let p=(0,s.scryptSync)(i,o,c),d=n.Buffer.alloc(u,0),m=(0,s.createDecipheriv)(l,p,d);try{let r=m.update(e,"hex","utf8");return r+=m.final("utf8")}catch(r){return console.log("Error in decrypting =>",r.message),global.ERROR_CALLBACK?.("Error Decrypting data",r),e}}},71934:(e,r,t)=>{t.d(r,{A:()=>n});var s=t(51779);async function n(...e){let r=(0,s.A)();try{if(!r)throw Error("No Connection provided to DB_HANDLER function!");let t=await r.query(...e);return JSON.parse(JSON.stringify(t))}catch(e){return global.ERROR_CALLBACK?.("DB_HANDLER Error",e),{success:!1,error:e.message}}finally{await r?.end()}}},51779:(e,r,t)=>{t.d(r,{A:()=>a});var s=t(9973),n=t.n(s);function a(e){return global.DSQL_USE_LOCAL||e?.local?global.DSQL_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:e?.noDb?void 0:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):e?.ro?global.DSQL_READ_ONLY_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_READ_ONLY_USERNAME,password:process.env.DSQL_DB_READ_ONLY_PASSWORD,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):e?.fa?global.DSQL_FULL_ACCESS_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_FULL_ACCESS_USERNAME,password:process.env.DSQL_DB_FULL_ACCESS_PASSWORD,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):global.DSQL_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:e?.noDb?void 0:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}})}},48243:(e,r,t)=>{t.d(r,{A:()=>s});function s(e){return{key:e?.encryptionKey||process.env.DSQL_ENCRYPTION_PASSWORD,keyLen:process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24,salt:e?.encryptionSalt||process.env.DSQL_ENCRYPTION_SALT,apiKey:e?.apiKey||process.env.DSQL_API_KEY,algorithm:e?.algorithm||process.env.DSQL_ENCRYPTION_ALGORITHM||"aes-192-cbc",bufferAllocSize:e?.bufferAllocSize||(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE?function(e,r){try{let r=Number(e);if("number"!=typeof r||isNaN(r))return 0;return Math.round(r)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE):void 0)||16}}},5583:(e,r,t)=>{t.r(r),t.d(r,{default:()=>a});var s=t(8732);t(82015);var n=t(20883);function a(){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`}),process.env.NEXT_PUBLIC_DSQL_HOST_ENV?.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",
|