1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[459],{3236:function(e,s,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/login",function(){return r(7468)}])},1454:function(e,s,r){"use strict";r.d(s,{Z:function(){return Card}});var a=r(5893),n=r(6336);function Card(e){return(0,a.jsx)("div",{className:(0,n.tw)("bg-white shadow rounded-md px-8 pt-6 pb-8",e.className),children:e.children})}},1064:function(e,s,r){"use strict";r.d(s,{W:function(){return Container}});var a=r(5893),n=r(6336);function Container(e){return(0,a.jsx)("div",{className:(0,n.tw)("max-w-7xl mx-auto px-4",e.className),style:e.style,children:e.children})}},8580:function(e,s,r){"use strict";r.d(s,{p:function(){return InputError}});var a=r(5893);function InputError(e){return e.children?(0,a.jsx)("div",{className:"text-red-700 text-sm pt-2",role:"alert",id:e.id,children:e.children}):null}},7468:function(e,s,r){"use strict";r.r(s),r.d(s,{default:function(){return Login}});var a=r(5893),n=r(1664),t=r.n(n),i=r(1163),l=r(9883),d=r(1454),c=r(1064),o=r(8580),u=r(175),m=r(5104);function Login(){var e,s;let r=(0,i.useRouter)();async function onSubmit(e){e.preventDefault();try{let s=await m.u.auth.login.mutate({email:e.target.email.value,password:e.target.password.value});console.log("result",s),(null==s?void 0:s.id)?r.push("/account"):r.push("/login?error=true")}catch(e){console.log("e",e),r.push("/login?error=".concat(e.message))}}return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(c.W,{className:"max-w-md pt-16",children:[(0,a.jsxs)(d.Z,{className:"mt-8",children:[(0,a.jsx)("h1",{className:"mb-2",children:"Login"}),"unauthenticated"===r.query.reason&&(0,a.jsx)("div",{className:"text-red-700",children:"Your session has expired."}),r.query.error&&(0,a.jsx)("div",{className:"text-red-700",children:"true"===r.query.error?"Invalid login":"Error: ".concat(r.query.error)}),"update-password"===r.query.reason&&(0,a.jsx)("div",{className:"text-success",children:"Your password has been updated, please use your new credentials below."}),(0,a.jsx)("hr",{}),(0,a.jsxs)("form",{method:"post",className:"",onSubmit:onSubmit,children:[(0,a.jsx)("input",{type:"hidden",name:"redirectTo",value:null!==(s=null===(e=r.query)||void 0===e?void 0:e.redirectTo)&&void 0!==s?s:void 0}),(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("label",{className:"sr-only",htmlFor:"email",children:"Email Address"}),(0,a.jsx)(u.o,{id:"email",name:"email",placeholder:"Email Address",defaultValue:""}),(0,a.jsx)(o.p,{id:"email-error"})]}),(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("label",{className:"sr-only",htmlFor:"password",defaultValue:"",children:"Password"}),(0,a.jsx)(u.o,{id:"password",name:"password",type:"password",placeholder:"Password"}),(0,a.jsx)(o.p,{id:"password-error"})]}),(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(l.z,{type:"submit",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("img",{src:"/img/airplane.svg",alt:"Airplane",className:"-ml-2"}),"Login"]})})}),(0,a.jsx)(t(),{className:"text-action",href:"/reset-password",children:"Reset Password"})]})]})]}),(0,a.jsxs)("div",{className:"pt-4 text-center",children:["Donât have an account?"," ",(0,a.jsx)(t(),{href:"/register",className:"text-action",children:"Sign up here"})]})]})})}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=3236)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.