dsql-admin/dsql-app/.local_dist/server/pages/send-password-reset-link.js

1 line
8.9 KiB
JavaScript
Raw Normal View History

2025-02-17 05:55:49 +00:00
"use strict";(()=>{var e={};e.id=6827,e.ids=[3220,6827],e.modules={30671:(e,t)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){return function e(t,s){return s in t?t[s]:"then"in t&&"function"==typeof t.then?t.then(t=>e(t,s)):"function"==typeof t&&"default"===s?t:void 0}}})},90678:(e,t,s)=>{s.r(t),s.d(t,{config:()=>L,default:()=>v,getServerSideProps:()=>E,getStaticPaths:()=>D,getStaticProps:()=>A,reportWebVitals:()=>b,routeModule:()=>M,unstable_getServerProps:()=>k,unstable_getServerSideProps:()=>I,unstable_getStaticParams:()=>w,unstable_getStaticPaths:()=>T,unstable_getStaticProps:()=>q});var r={};s.r(r),s.d(r,{SendPassResetContext:()=>_,default:()=>P,getServerSideProps:()=>y});var a=s(63865),n=s(9455),i=s(30671),o=s(5583),l=s(53881),c=s(8732),d=s(82015),p=s.n(d),u=s(26228),m=s(91258),x=s(16757),g=s(92702),h=s(46169),S=s(90048);let j=(0,s(82544).A)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);function f({message:e}){return(0,c.jsxs)("div",{className:"info gray",children:[(0,c.jsx)(j,{}),(0,c.jsx)("span",{className:"font-normal",children:e})]})}let _=p().createContext({});function P(e){let t="Cloudbased SQL data management system | Datasquirel",s="Datasquirel is a fast and efficient cloud-based SQL data management system that takes away the entire hassle of dealing with data both locally and across different platforms.",r=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("title",{children:t}),(0,c.jsx)("meta",{name:"description",content:s}),(0,c.jsx)(m.A,{pageTitle:t,pageDescription:s,pagePathname:"/"})]}),[a,n]=p().useState(!1),[i,o]=p().useState(!1);return(0,c.jsx)(u.A,{head:r,user:e.user,children:(0,c.jsx)(_.Provider,{value:{user:e.user},children:(0,c.jsx)("main",{children:(0,c.jsxs)("section",{children:[a&&(0,c.jsx)(x.A,{}),i?(0,c.jsx)(S.A,{message:"Email Sent. Please check your email address and follow the link provided",className:"whitespace-nowrap"}):(0,c.jsx)("div",{className:"paper",children:(0,c.jsxs)("div",{className:"max-w-xl flex-col items-stretch",children:[(0,c.jsx)("h1",{className:"m-0 text-4xl",children:"Send Password Reset Link"}),(0,c.jsx)("span",{children:"Please enter your email address to receive a password reset link"}),(0,c.jsxs)("form",{className:"w-full flex flex-col items-stretch gap-4",onSubmit:e=>{n(!0),e.preventDefault();let t=e.target["email-address"].value;(0,h.A)(`/api/sendPasswordResetLink?email=${t}`).then(e=>{console.log(e),setTimeout(()=>{n(!1)},500),e.success&&o(!0)})},children:[(0,c.jsx)("input",{type:"text",autoComplete:"email",name:"email-address",id:"email-address",className:"w-full",placeholder:"Email Address",defaultValue:e?.user?.logged_in_status?e.user.email:"",required:!0}),(0,c.jsx)("button",{children:"Send password reset Email"}),(0,c.jsx)(f,{message:"Please note that this link will expire after 1 hour"})]})]})})]})})})})}async function y({req:e,res:t}){let{user:s,appData:r}=await (0,g.A)(e,t);return s?.social_login?{redirect:{destination:"/",permanent:!1}}:{props:{user:s,appData:r}}}let v=(0,i.M)(r,"default"),A=(0,i.M)(r,"getStaticProps"),D=(0,i.M)(r,"getStaticPaths"),E=(0,i.M)(r,"getServerSideProps"),L=(0,i.M)(r,"config"),b=(0,i.M)(r,"reportWebVitals"),q=(0,i.M)(r,"unstable_getStaticProps"),T=(0,i.M)(r,"unstable_getStaticPaths"),w=(0,i.M)(r,"unstable_getStaticParams"),k=(0,i.M)(r,"unstable_getServerProps"),I=(0,i.M)(r,"unstable_getServerSideProps"),M=new a.PagesRouteModule({definition:{kind:n.A.PAGES,page:"/send-password-reset-link",pathname:"/send-password-reset-link",bundlePath:"",filename:""},components:{App:l.default,Document:o.default},userland:r})},60149:(e,t,s)=>{s.d(t,{On:()=>a.a,Yv:()=>i.a,_n:()=>l}),s(76102);var r=s(65967),a=s.n(r),n=s(30889),i=s.n(n),o=s(93726);let l=s.n(o)()},90048:(e,t,s)=>{s.d(t,{A:()=>a});var r=s(8732);function a({message:e,className:t}){return(0,r.jsxs)("div",{className:"info green"+(t?" "+t:""),children:[(0,r.jsx)("img",{src:"/images/checkmark.svg",alt:"Warning Image Icon",width:22,className:"-my-2"}),(0,r.jsx)("span",{children:e})]})}s(82015)}