1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
|
"use strict";(()=>{var e={};e.id=6827,e.ids=[636,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}}})},67097:(e,t,s)=>{s.r(t),s.d(t,{config:()=>A,default:()=>q,getServerSideProps:()=>D,getStaticPaths:()=>b,getStaticProps:()=>E,reportWebVitals:()=>N,routeModule:()=>C,unstable_getServerProps:()=>L,unstable_getServerSideProps:()=>I,unstable_getStaticParams:()=>k,unstable_getStaticPaths:()=>M,unstable_getStaticProps:()=>w});var r={};s.r(r),s.d(r,{SendPassResetContext:()=>v,default:()=>P,getServerSideProps:()=>j});var i=s(63865),a=s(9455),n=s(30671),o=s(49407),l=s(68268),u=s(8732),c=s(82015),p=s.n(c),m=s(71457),d=s(87472),x=s(32415),h=s(20048),f=s.n(h),g=s(63715),S=s(13002),_=s(49240);function y({message:e}){return(0,u.jsxs)("div",{className:"info gray",children:[(0,u.jsx)(_.A,{fontSize:"small",color:"inherit",className:"opacity-50 text-gray-600"}),(0,u.jsx)("span",{className:"font-normal",children:e})]})}let v=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,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("title",{children:t}),(0,u.jsx)("meta",{name:"description",content:s}),(0,u.jsx)(d.A,{pageTitle:t,pageDescription:s,pagePathname:"/"})]}),[i,a]=p().useState(!1),[n,o]=p().useState(!1);return(0,u.jsx)(m.A,{head:r,user:e.user,children:(0,u.jsx)(v.Provider,{value:{user:e.user},children:(0,u.jsx)("main",{children:(0,u.jsxs)("section",{children:[i&&(0,u.jsx)(x.A,{}),n?(0,u.jsx)(S.A,{message:"Email Sent. Please check your email address and follow the link provided",className:"whitespace-nowrap"}):(0,u.jsx)("div",{className:"paper",children:(0,u.jsxs)("div",{className:"max-w-xl flex-col items-stretch",children:[(0,u.jsx)("h1",{className:"m-0 text-4xl",children:"Send Password Reset Link"}),(0,u.jsx)("span",{children:"Please enter your email address to receive a password reset link"}),(0,u.jsxs)("form",{className:"w-full flex flex-col items-stretch gap-4",onSubmit:e=>{a(!0),e.preventDefault();let t=e.target["email-address"].value;(0,g.A)(`/api/sendPasswordResetLink?email=${t}`).then(e=>{console.log(e),setTimeout(()=>{a(!1)},500),e.success&&o(!0)})},children:[(0,u.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,u.jsx)("button",{children:"Send password reset Email"}),(0,u.jsx)(y,{message:"Please note that this link will expire after 1 hour"})]})]})})]})})})})}async function j({req:e,res:t}){let s=await f()(e,t);return s?.social_login?{redirect:{destination:"/",permanent:!1}}:{props:{user:s}}}let q=(0,n.M)(r,"default"),E=(0,n.M)(r,"getStaticProps"),b=(0,n.M)(r,"getStaticPaths"),D=(0,n.M)(r,"getServerSideProps"),A=(0,n.M)(r,"config"),N=(0,n.M)(r,"reportWebVitals"),w=(0,n.M)(r,"unstable_getStaticProps"),M=(0,n.M)(r,"unstable_getStaticPaths"),k=(0,n.M)(r,"unstable_getStaticParams"),L=(0,n.M)(r,"unstable_getServerProps"),I=(0,n.M)(r,"unstable_getServerSideProps"),C=new i.PagesRouteModule({definition:{kind:a.A.PAGES,page:"/send-password-reset-link",pathname:"/send-password-reset-link",bundlePath:"",filename:""},components:{App:l.default,Document:o.default},userland:r})},13002:(e,t,s)=>{s.d(t,{A:()=>i});var r=s(8732);function i({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)},20048:(e,t,s)=>{s(81630);let r=s(67216),i=s(77463),a=s(29021),n=s(6505);async function o(e,t,s,o){let{keyCookieName:l,csrfCookieName:u}=n();if(!e.cookies?.[l]?.match(/./))return null;let c=i({encryptedString:e.cookies[l]});if(!c)r
|