PageSourceSearch

https://www.consultkit.ai/_next/static/chunks/pages/login-3dbb8959418b74f5.js

js consultkit.ai collected 2026-10-05 12:22:08 UTC 5,037 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3459],{83236:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/login",function(){return n(71123)}])},82126:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});let i=(0,n(31134).Z)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},86691:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});let i=(0,n(31134).Z)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]])},27778:function(e,t,n){"use strict";n.d(t,{a:function(){return a}});var i=n(85893);function a(e){let{message:t="Checking your account..."}=e;return(0,i.jsx)("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center","data-testid":"auth-loading",children:(0,i.jsxs)("div",{className:"flex flex-col items-center",children:[(0,i.jsx)("img",{src:"/logo-mark.png",alt:"ConsultKit",className:"w-10 h-10 rounded-sm mb-6"}),(0,i.jsxs)("div",{className:"flex items-center gap-1.5 mb-4",children:[(0,i.jsx)("span",{className:"w-2 h-2 rounded-full bg-slate-400 animate-[pulse_1.4s_ease-in-out_infinite]"}),(0,i.jsx)("span",{className:"w-2 h-2 rounded-full bg-slate-400 animate-[pulse_1.4s_ease-in-out_0.2s_infinite]"}),(0,i.jsx)("span",{className:"w-2 h-2 rounded-full bg-slate-400 animate-[pulse_1.4s_ease-in-out_0.4s_infinite]"})]}),(0,i.jsx)("p",{className:"font-mono text-xs text-slate-400 tracking-wide",children:t})]})})}},33259:function(e,t,n){"use strict";n.d(t,{$F:function(){return s},Au:function(){return r}});var i=n(28599),a=n(68444);async function s(e){let t=(0,i.e)();e&&"temp"!==e&&localStorage.setItem("auth_redirect_subdomain",e);let n=window.location.origin,{data:a,error:s}=await t.auth.signInWithOAuth({provider:"google",options:{redirectTo:"".concat(n,"/api/auth/callback"),queryParams:{access_type:"offline",prompt:"consent"}}});if(s)throw s;return a}async function r(){try{return(await (0,a._)("/api/auth/workspace")).workspace}catch(e){return null}}},71123:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var i=n(85893),a=n(67294),s=n(11163),r=n(86691),o=n(82126),l=n(28599),u=n(33259),c=n(13538),d=n(27778);function h(){let e=(0,s.useRouter)(),[t,n]=(0,a.useState)(""),[h,g]=(0,a.useState)(""),[f,m]=(0,a.useState)(!1),[p,x]=(0,a.useState)(null),[w,y]=(0,a.useState)(!1),[_,j]=(0,a.useState)(!0),v="true"===e.query.created,b=(()=>{let t=e.query.next;return"string"==typeof t&&/^\/[a-zA-Z0-9][a-zA-Z0-9\-_/]*$/.test(t)?t:null})();(0,a.useEffect)(()=>{(async()=>{let t=(0,l.e)(),{data:{user:n},error:i}=await t.auth.getUser();if(i||!n){j(!1);return}let a=await (0,u.Au)();a?e.push(null!=b?b:"/".concat(a.subdomain,"/admin")):e.push("/auth/complete-signup")})()},[e]);let k=async()=>{try{y(!0),x(null),await (0,u.$F)("")}catch(e){console.error("Google sign in error:",e),x("Failed to sign in with Google"),y(!1)}},S=async n=>{if(n.preventDefault(),m(!0),x(null),!t||!h){x("Email and password are required"),m(!1);return}try{let n=(0,l.e)(),{data:i,error:a}=await n.auth.signInWithPassword({email:t,password:h});if(a)throw Error(a.message);if(!i.user)throw Error("Authentication failed");let s=await (0,u.Au)();if(!s){e.push("/auth/complete-signup");return}localStorage.setItem("userEmail",i.user.email),e.push(null!=b?b:"/".concat(s.subdomain,"/admin"))}catch(e){console.error("Login error:",e),x(e.message||"Invalid email or password")}finally{m(!1)}};return _?(0,i.jsx)(d.a,{message:"Checking your account..."}):(0,i.jsxs)(c.fQ,{title:"Sign in",subtitle:"Enter your credentials to continue",variant:"login",children:[v&&(0,i.jsx)(c.ec,{children:"Account created! Please sign in to continue."}),p&&(0,i.jsxs)(c.Wt,{children:[p,p.toLowerCase().includes("invalid")&&(0,i.jsx)("div",{style:{marginTop:4,opacity:.8},children:"If you signed up with Google, try the Google button instead."})]}),(0,i.jsxs)("form",{onSubmit:S,style:{display:"flex",flexDirection:"column",gap:12,marginBottom:14},children:[(0,i.jsx)(c.vy,{icon:r.Z,type:"email",placeholder:"Email address",value:t,onChange:n,disabled:f,id:"email",required:!0}),(0,i.jsx)(c.vy,{icon:o.Z,type:"password",placeholder:"Password",value:h,onChange:g,disabled:f,id:"password",required:!0}),(0,i.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",margin:"4px 0 8px"},children:(0,i.jsx)(c.gK,{href:"/auth/forgot-password",children:"Forgot password?"})}
1),(0,i.jsx)(c.IR,{type:"submit",loading:f,children:f?"Signing in...":"Sign in"})]}),(0,i.jsx)("div",{style:{margin:"18px 0"},children:(0,i.jsx)(c.$s,{})}),(0,i.jsx)(c.JR,{onClick:k,loading:f||w,label:w?"Signing in...":"Continue with Google"}),(0,i.jsxs)("div",{style:{marginTop:24,textAlign:"center",fontSize:12,color:"rgba(21,20,15,0.4)"},children:["Don’t have an account?"," ",(0,i.jsx)(c.gK,{href:"/signup",children:"Start free trial"})]})]})}}},function(e){e.O(0,[1664,3538,2888,9774,179],function(){return e(e.s=83236)}),_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.