1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3567],{43524:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var a=n(37876),s=n(14232),i=n(89099),r=n(20620),l=n(44454),o=n(44929),c=n(91911),u=n.n(c);function d(e){let t=Array.isArray(e)?e[0]:e;return"string"!=typeof t||!t.startsWith("/admin")||t.startsWith("//")?"/admin":t}function h(){let e=(0,i.useRouter)(),[t,n]=(0,s.useState)(""),[c,h]=(0,s.useState)(""),[m,g]=(0,s.useState)(!1),[p,y]=(0,s.useState)(null);(0,s.useEffect)(()=>{let t=!1;return(0,l.FH)("/auth/me").then(()=>{t||e.replace(d(e.query.next))}).catch(()=>{}),()=>{t=!0}},[e]);let f=async n=>{n.preventDefault(),g(!0),y(null);try{await (0,l.FH)("/auth/login",{method:"POST",body:{email:t,password:c}}),e.replace(d(e.query.next))}catch(e){y(e instanceof l.hD?e:new l.hD("Sign in failed.")),g(!1)}};return(0,a.jsxs)("div",{className:"".concat(u().admin," ").concat(u().loginPage),children:[(0,a.jsx)(r.Wl,{title:"Sign in"}),(0,a.jsx)("div",{className:u().loginWrap,children:(0,a.jsxs)("form",{className:u().loginCard,onSubmit:f,children:[(0,a.jsx)("div",{className:u().loginBrand,children:"AskGalore CMS"}),(0,a.jsx)("p",{className:u().pageSub,style:{marginBottom:20},children:"Sign in to manage the site."}),(0,a.jsx)(o.Pf,{error:p}),(0,a.jsx)(o.A_,{label:"Email",type:"email",value:t,onChange:n,autoComplete:"username",required:!0}),(0,a.jsx)(o.A_,{label:"Password",type:"password",value:c,onChange:h,autoComplete:"current-password",required:!0}),(0,a.jsx)("button",{type:"submit",className:"".concat(u().btn," ").concat(u().btnPrimary),disabled:m,style:{width:"100%",marginTop:8},children:m?"Signing inâ¦":"Sign in"}),(0,a.jsx)("p",{className:u().hint,style:{marginTop:14},children:"Sessions last 8 hours. Access is enforced by the API, not by this screen."})]})})]})}},63530:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/login",function(){return n(43524)}])}},e=>{e.O(0,[9396,90636,46593,38792],()=>e(e.s=63530)),_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.