PageSourceSearch

https://fillrate.app/assets/auth-page-9HZs-Wjc.js

js fillrate.app collected 2026-10-02 01:13:22 UTC 9,607 bytes, 1 lines download raw bytes

1import{c as X,r as a,u as v,j as e,I as p,L as j,B as y,S as O,q as w,a as N}from"./index-BxMItG-b.js";import{L as g}from"./label-w-YTA7Tz.js";import{I as q,a as A,b as D}from"./input-otp-DZRhyZ_f.js";import{F as k}from"./fillrate-logo-BKlgisZ7.js";import{Z as S}from"./zap-DSC58WOA.js";import{B as M}from"./brain-B5_rqp4g.js";import{S as B}from"./shield-CcYJTeLv.js";import{C as U}from"./circle-check-D9xMYh3n.js";const V=X("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]),K=[{icon:M,text:"AI matches candidates to roles instantly"},{icon:S,text:"One-click CV branding in under 30 seconds"},{icon:B,text:"E-sign, invoicing & compliance built in"}];function H(){const[i,C]=a.useState(""),[l,P]=a.useState(""),[n,s]=a.useState(""),[I,d]=a.useState("password"),[o,c]=a.useState(""),[r,F]=a.useState(!1),[u,x]=a.useState(""),[f,E]=a.useState(!1),R=new URLSearchParams(window.location.search).get("reset")==="1",m=v({mutationFn:async()=>(await N("POST","/api/auth/login",{email:i,password:l})).json(),onSuccess:t=>{if(s(""),t?.requires2fa){d("2fa");return}w.invalidateQueries({queryKey:["/api/auth/me"]})},onError:t=>{s(t.message.includes("401")?"Invalid email or password":"Login failed. Please try again.")}}),h=v({mutationFn:async()=>{const t={trustDevice:f};return r?t.recoveryCode=u:t.code=o,(await N("POST","/api/auth/2fa/challenge",t)).json()},onSuccess:()=>{s(""),w.invalidateQueries({queryKey:["/api/auth/me"]})},onError:t=>{t.message.includes("429")?s("Too many attempts. Please wait 15 minutes and try again."):t.message.includes("400")&&t.message.toLowerCase().includes("no pending")?(s("Your sign-in expired. Please enter your password again."),d("password")):s("Invalid code. Please try again.")}}),L=t=>{if(t.preventDefault(),!i||!l){s("Please enter both email and password");return}s(""),m.mutate()},T=t=>{if(t.preventDefault(),r?!u:o.length!==6){s(r?"Enter your recovery code":"Enter the 6-digit code");return}s(""),h.mutate()};return e.jsxs("div",{className:"min-h-screen flex",style:{fontFamily:"'Inter', system-ui, sans-serif"},children:[e.jsxs("div",{className:"hidden lg:flex lg:w-[45%] relative flex-col bg-[#060c18] p-10 overflow-hidden",children:[e.jsxs("div",{className:"absolute inset-0 pointer-events-none overflow-hidden",children:[e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[600px] h-[400px] bg-gradient-to-b from-blue-600/15 via-violet-600/8 to-transparent rounded-full blur-3xl"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-[300px] h-[300px] bg-violet-600/5 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute inset-0 opacity-[0.025]",style:{backgroundImage:"linear-gradient(rgba(255,255,255,0.4) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.4) 1px, transparent 1px)",backgroundSize:"48px 48px"}})]}),e.jsxs("div",{className:"relative flex flex-col h-full",children:[e.jsx(k,{variant:"light",className:"h-7 w-auto self-start","data-testid":"text-login-title"}),e.jsxs("div",{className:"flex-1 flex flex-col justify-center py-12",children:[e.jsxs("div",{className:"space-y-2 mb-10",children:[e.jsxs("div",{className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-blue-500/10 border border-blue-500/20 text-blue-300 text-xs font-semibold uppercase tracking-widest mb-4",children:[e.jsx(S,{className:"h-3 w-3"})," AI Recruitment CRM"]}),e.jsxs("h2",{className:"text-3xl font-bold text-white leading-tight",children:["The smarter way",e.jsx("br",{}),"to run your desk."]}),e.jsx("p",{className:"text-white/40 text-base leading-relaxed max-w-xs",children:"AI-powered tools that eliminate admin and keep your pipeline moving — automatically."})]}),e.jsx("div",{className:"space-y-4",children:K.map((t,b)=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-9 w-9 rounded-xl bg-white/[0.06] border border-white/[0.08] flex items-center justify-center shrink-0",children:e.jsx(t.icon,{className:"h-4 w-4 text-blue-400"})}),e.jsx("p",{className:"text-sm text-white/60",children:t.text})]},b))})]}),e.jsxs("p",{className:"text-[11px] text-white/20",children:["© ",new Date().getFullYear()," Optio Auctus Ltd · FillRate"]})]})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center bg-[#fafbfc] dark:bg-background p-6",children:e.jsxs("div",{className:"w-full max-w-sm space-y-7",children:[e.jsx("div",{className:"lg:hidden flex justify-center",children:e.jsx(k,{className:"h-9 w-auto"})}),I==="password"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground tracking-tight",children:"Welcome back"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign in to your recruitment CRM"})]}),R&&e.jsxs("div",{className:"rounded-lg bg-emerald-50 dark:bg-emerald-950/40 border border-emerald-200 dark:border-emerald-800 px-3 py-2.5 flex items-center gap-2","data-testid":"banner-reset-success",children:[e.jsx(U,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400 shrink-0"}),e.jsx("p",{className:"text-sm text-emerald-700 dark:text-emerald-300",children:"Password updated — sign in with your new password."})]}),e.jsxs("form",{onSubmit:L,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{htmlFor:"email",className:"text-sm font-medium",children:"Email"}),e.jsx(p,{id:"email",type:"email",value:i,onChange:t=>C(t.target.value),placeholder:"[email protected]",autoComplete:"email",className:"h-11","data-testid":"input-email"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(g,{htmlFor:"password",className:"text-sm font-medium",children:"Password"}),e.jsx(j,{href:"/forgot-password",className:"text-xs text-muted-foreground hover:text-primary hover:underline transition-colors","data-testid":"link-forgot-password",children:"Forgot password?"})]}
1),e.jsx(p,{id:"password",type:"password",value:l,onChange:t=>P(t.target.value),placeholder:"Enter your password",autoComplete:"current-password",className:"h-11","data-testid":"input-password"})]}),n&&e.jsx("div",{className:"rounded-lg bg-destructive/8 border border-destructive/20 px-3 py-2.5",children:e.jsx("p",{className:"text-sm text-destructive","data-testid":"text-login-error",children:n})}),e.jsx(y,{type:"submit",className:"w-full h-11 font-semibold rounded-lg",disabled:m.isPending,"data-testid":"button-login",children:m.isPending?"Signing in...":e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"h-4 w-4 mr-2"})," Sign In"]})})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-border"})}),e.jsx("div",{className:"relative flex justify-center",children:e.jsx("span",{className:"bg-[#fafbfc] dark:bg-background px-3 text-xs text-muted-foreground",children:"or"})})]}),e.jsxs("p",{className:"text-sm text-muted-foreground text-center",children:["Don't have an account?"," ",e.jsx(j,{href:"/#apply",className:"text-primary font-semibold hover:underline","data-testid":"link-signup",children:"Join the waitlist"})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 text-blue-600 dark:text-blue-400 text-xs font-semibold",children:[e.jsx(O,{className:"h-3.5 w-3.5"})," Two-factor authentication"]}),e.jsx("h1",{className:"text-2xl font-bold text-foreground tracking-tight",children:"Enter your code"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r?"Enter one of your recovery codes.":"Open your authenticator app and enter the 6-digit code."})]}),e.jsxs("form",{onSubmit:T,className:"space-y-4",children:[r?e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{children:"Recovery code"}),e.jsx(p,{value:u,onChange:t=>x(t.target.value),placeholder:"XXXXX-XXXXX",className:"h-11 font-mono",autoFocus:!0,"data-testid":"input-2fa-recovery"})]}):e.jsx("div",{className:"flex justify-center",children:e.jsx(q,{maxLength:6,value:o,onChange:c,autoFocus:!0,children:e.jsx(A,{children:[0,1,2,3,4,5].map(t=>e.jsx(D,{index:t,"data-testid":`input-2fa-slot-${t}`},t))})})}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground select-none cursor-pointer","data-testid":"label-trust-device",children:[e.jsx("input",{type:"checkbox",className:"h-4 w-4 rounded border-input accent-primary",checked:f,onChange:t=>E(t.target.checked),"data-testid":"checkbox-trust-device"}),e.jsx("span",{children:"Trust this device for 30 days"})]}),n&&e.jsx("div",{className:"rounded-lg bg-destructive/8 border border-destructive/20 px-3 py-2.5",children:e.jsx("p",{className:"text-sm text-destructive","data-testid":"text-2fa-error",children:n})}),e.jsx(y,{type:"submit",className:"w-full h-11 font-semibold rounded-lg",disabled:h.isPending,"data-testid":"button-2fa-submit",children:h.isPending?"Verifying...":"Verify and sign in"}),e.jsx("button",{type:"button",className:"w-full text-xs text-muted-foreground hover:text-foreground underline",onClick:()=>{F(t=>!t),s(""),c(""),x("")},"data-testid":"button-2fa-toggle-recovery",children:r?"Use 6-digit code instead":"Use a recovery code instead"}),e.jsx("button",{type:"button",className:"w-full text-xs text-muted-foreground hover:text-foreground",onClick:()=>{d("password"),c(""),x(""),s("")},"data-testid":"button-2fa-back",children:"Back to sign-in"})]})]})]})})]})}export{H as default};

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.