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

1 line
10 KiB
JavaScript
Raw Normal View History

2024-12-05 07:03:33 +00:00
"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:()=>D,default:()=>_,getServerSideProps:()=>E,getStaticPaths:()=>A,getStaticProps:()=>b,reportWebVitals:()=>w,routeModule:()=>T,unstable_getServerProps:()=>L,unstable_getServerSideProps:()=>R,unstable_getStaticParams:()=>N,unstable_getStaticPaths:()=>k,unstable_getStaticProps:()=>M});var r={};s.r(r),s.d(r,{SendPassResetContext:()=>j,default:()=>v,getServerSideProps:()=>q});var i=s(63865),a=s(9455),n=s(30671),o=s(49407),u=s(68268),l=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),y=s(49240);function P({message:e}){return(0,l.jsxs)("div",{className:"info gray",children:[(0,l.jsx)(y.A,{fontSize:"small",color:"inherit",className:"opacity-50 text-gray-600"}),(0,l.jsx)("span",{className:"font-normal",children:e})]})}let j=p().createContext({});function v(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,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("title",{children:t}),(0,l.jsx)("meta",{name:"description",content:s}),(0,l.jsx)(d.A,{pageTitle:t,pageDescription:s,pagePathname:"/"})]}),[i,a]=p().useState(!1),[n,o]=p().useState(!1);return(0,l.jsx)(m.A,{head:r,user:e.user,children:(0,l.jsx)(j.Provider,{value:{user:e.user},children:(0,l.jsx)("main",{children:(0,l.jsxs)("section",{children:[i&&(0,l.jsx)(x.A,{}),n?(0,l.jsx)(S.A,{message:"Email Sent. Please check your email address and follow the link provided",className:"whitespace-nowrap"}):(0,l.jsx)("div",{className:"paper",children:(0,l.jsxs)("div",{className:"max-w-xl flex-col items-stretch",children:[(0,l.jsx)("h1",{className:"m-0 text-4xl",children:"Send Password Reset Link"}),(0,l.jsx)("span",{children:"Please enter your email address to receive a password reset link"}),(0,l.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,l.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,l.jsx)("button",{children:"Send password reset Email"}),(0,l.jsx)(P,{message:"Please note that this link will expire after 1 hour"})]})]})})]})})})})}async function q({req:e,res:t}){let s=await f()(e,t);return s?.social_login?{redirect:{destination:"/",permanent:!1}}:{props:{user:s}}}let _=(0,n.M)(r,"default"),b=(0,n.M)(r,"getStaticProps"),A=(0,n.M)(r,"getStaticPaths"),E=(0,n.M)(r,"getServerSideProps"),D=(0,n.M)(r,"config"),w=(0,n.M)(r,"reportWebVitals"),M=(0,n.M)(r,"unstable_getStaticProps"),k=(0,n.M)(r,"unstable_getStaticPaths"),N=(0,n.M)(r,"unstable_getStaticParams"),L=(0,n.M)(r,"unstable_getServerProps"),R=(0,n.M)(r,"unstable_getServerSideProps"),T=new i.PagesRouteModule({definition:{kind:a.A.PAGES,page:"/send-password-reset-link",pathname:"/send-password-reset-link",bundlePath:"",filename:""},components:{App:u.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(83007),a=s(29021);async function n(e,t,s,n){if(!e.cookies?.datasquirelAuthKey?.match(/./))return null;let o=i(e.cookies.datasquirelAuthKey);if(!o)return null;let u=JSON.parse(o);if(!u.cs