1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3459],{7156:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/login",function(){return r(80456)}])},97207:function(e,t,r){"use strict";var s=r(85893),a=(r(67294),r(80471));t.Z=function(e){var t=e.children,r=e.classes,n=e.isSubmitting;return(0,s.jsx)("button",{className:"".concat(r," button"),disabled:n,type:"submit",children:n?(0,s.jsx)(a.frZ,{size:"1.2em",className:"animate animate-spin mx-auto"}):t})}},81070:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var s=r(85893),a=r(9008),n=r(11163);function i(e){var t=e.title,r=e.description,i=e.image,c=e.url,o=(0,n.useRouter)(),l="".concat("https://naijabarrister.com").concat(o.asPath);return(0,s.jsxs)(a.default,{children:[(0,s.jsx)("title",{children:t?"".concat(t," - ").concat("NaijaBarrister | Find verified lawyers in Nigeria"):"NaijaBarrister | Find verified lawyers in Nigeria"}),(0,s.jsx)("meta",{name:"description",content:r||"Providing easy access to Nigerian laws, lawyers and legal resources. Naijabarrister.com is managed by Legalhub Associates and Solutions Ltd, a limited liability company registered in Nigeria"}),(0,s.jsx)("meta",{name:"robots",content:"noindex,nofollow"}),(0,s.jsx)("meta",{property:"og:type",content:"article"}),(0,s.jsx)("meta",{property:"og:image",content:i||"".concat("https://naijabarrister.com","/images/logo.png")}),(0,s.jsx)("meta",{property:"og:url",content:c||l}),(0,s.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,s.jsx)("meta",{property:"og:site_name",content:"NaijaBarrister | Find verified lawyers in Nigeria"}),(0,s.jsx)("meta",{name:"robots",content:"index,follow"})]})}},47355:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});var s=r(85893),a=r(81070);function n(e){var t=e.children,r=e.title,n=e.url,i=e.image,c=e.description;return(0,s.jsxs)("div",{className:"min-h-screen",children:[(0,s.jsx)(a.Z,{title:r,url:n,image:i,description:c}),t]})}},43977:function(e,t,r){"use strict";var s=r(85893);r(67294);t.Z=function(e){var t=e.children;return(0,s.jsx)("div",{className:"text-sm text-red-500 my-1",children:t})}},80456:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return w}});var s=r(85893),a=r(25675),n=r(34051),i=r.n(n),c=r(82175),o=r(67294),l=r(74931),d=r(41664),u=r(11163),m=r(8193),x=r(74231),h=r(43977),p=r(40611),j=r(97207),f=r(2282);function g(e,t,r,s,a,n,i){try{var c=e[n](i),o=c.value}catch(l){return void r(l)}c.done?t(o):Promise.resolve(o).then(s,a)}var v=x.Ry().shape({email:x.Z_().email("Please enter a valid email").required("Email is required"),password:x.Z_().min(8,"Minimum of 8 characters").required("Password is required")});function N(){var e=(0,o.useState)(!1),t=e[0],r=e[1],a=(0,o.useState)(null),n=a[0],x=a[1],N=(0,f.a)().setUser,b=(0,u.useRouter)();return(0,s.jsx)("div",{children:(0,s.jsx)(c.J9,{initialValues:{email:"",password:"",rememberMe:!1},onSubmit:function(){var e,t=(e=i().mark((function e(t,r){var s,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.setSubmitting,x(null),e.prev=2,e.next=5,p.Z.post("/api/users/login",t);case 5:s=e.sent.data,N(s),l.ZP.success("Login successful!"),b.push("/dashboard"),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(2),a=400===e.t0.response.status?"Email and password don't match":404===e.t0.response.status?"Invalid login credentials":"An error occurred, please try again",x(a);case 16:case"end":return e.stop()}}),e,null,[[2,11]])})),function(){var t=this,r=arguments;return new Promise((function(s,a){var n=e.apply(t,r);function i(e){g(n,s,a,i,c,"next",e)}function c(e){g(n,s,a,i,c,"throw",e)}i(void 0)}))});return function(e,r){return t.apply(this,arguments)}}(),validationSchema:v,children:function(e){var a=e.errors,i=e.isSubmitting,o=e.touched;return(0,s.jsxs)(c.l0,{children:[(0,s.jsx)("h1",{className:"title text-xl",children:"Login"}),n&&(0,s.jsx)("div",{className:"px-3 py-2 rounded-md bg-red-100 border border-red-200 text-red-800 mb-4 text-sm",children:n}),(0,s.jsxs)("div",{className:"field",children:[(0,s.jsx)(c.gN,{name:"email",type:"email",placeholder:"Email address",className:" ".concat(a.email&&o.email?"has-error":""," input")}),(0,s.jsx)(c.Bc,{component:h.Z,name:"email"})]}),(0,s.jsxs)("div",{className:"field relative",children:[(0,s.jsx)(c.gN,{name:"password",type:t?"text":"password",placeholder:"Password",className:"".concat(a.password&&o.password?"has-error":""," input")}),(0,s.jsx)("button",{className:"".concat(t?"text-gray-400":"text-gray-300"," absolute z-10 top-2 right-2 text-3xl"),onClick:function(){return r(!t)},type:"button",children:t?(0,s.jsx)(m.Zju,{}):(0,s.jsx)(m.I0d,{})}),(0,s.jsx)(c.Bc,{component:h.Z,name:"password"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4 field",children:[(0,s.jsx)("div",{children:(0,s.jsxs)("label",{className:"flex items-center",children:[(0,s.jsx)(c.gN,{type:"checkbox",name:"rememberMe",className:"mr-1"})," ","Remember me"]})}),(0,s.jsx)("div",{className:"text-right",children:(0,s.jsx)(d.default,{href:"/forgot-password",children:(0,s.jsx)("a",{children:"Forgot password?"})})})]}),(0,s.jsx)("div",{className:"field",children:(0,s.jsx)(j.Z,{isSubmitting:i,classes:"primary full",children:"Login"})})]})}})})}var b=r(47355);function w(){var e=(0,u.useRouter)(),t=(0,f.a)(),r=t.user;return t.loading?null:(r&&e.push("/"),(0,s.jsx)(b.Z,{title:"Login",description:"Login or create an account to use MBN",children:(0,s.jsxs)("div",{className:"bg-slate-100 min-h-screen md:pt-24 pt-12 px-4",children:[(0,s.jsx)("div",{className:"mx-auto text-center",children:(0,s.jsx)(d.default,{href:"/",children:(0,s.jsx)("a",{className:"text-slate-800 text-xl",children:(0,s.jsx)(a.default,{src:"/images/logo.svg",alt:"NaijaBarrister",width:120,height:48})})})}),(0,s.jsxs)("div",{className:"max-w-md mx-auto ",children:[(0,s.jsx)("div",{className:"bg-white md:p-8 p-4 rounded-lg drop-shadow-md border border-slate-300",children:(0,s.jsx)("div",{children:(0,s.jsx)(N,{})})}),(0,s.jsxs)("p",{className:"mt-8 text-center",children:["Don't have an account?"," ",(0,s.jsx)(d.default,{href:"/signup",children:(0,s.jsx)("a",{className:"font-bold text-blue-600",children:"Create a free account"})})]})]})]})}))}}},function(e){e.O(0,[955,4617,3276,2175,4231,9774,2888,179],(function(){return t=7156,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.