PageSourceSearch

https://boombam.app/assets/reset-password-BHblm1er.js

js boombam.app collected 2026-10-04 13:33:00 UTC 5,928 bytes, 1 lines download raw bytes

1import{r,bo as q,_ as F,a6 as Y,j as e,L as l,bk as x,bl as u,C as w,b as p,d as g,e as j,k as f,h as A,m as b,bn as v,B as i,o as I,ab as N,bm as y,bp as P,E as C,f as z,a7 as D}from"./index-CuSEeJFb.js";function G(){const[o,k]=r.useState(""),[h,B]=r.useState(""),[c,L]=r.useState(!1),[d,S]=r.useState(!1),[m,R]=r.useState(!1),[,E]=q(),{toast:a}=F(),n=new URLSearchParams(window.location.search).get("token");r.useEffect(()=>{n||a({title:"Invalid reset link",description:"This reset link is invalid or has expired.",variant:"destructive"})},[n,a]);const t=Y({mutationFn:async s=>(await D("POST","/api/auth/reset-password")).json(),onSuccess:()=>{R(!0),a({title:"Password reset successful!",description:"Your password has been updated. You can now login with your new password."})},onError:s=>{a({title:"Password reset failed",description:s.message||"Failed to reset password. The link may have expired.",variant:"destructive"})}}),T=s=>{if(s.preventDefault(),!n){a({title:"Invalid reset link",description:"This reset link is invalid or has expired.",variant:"destructive"});return}if(o!==h){a({title:"Passwords don't match",description:"Please make sure both passwords are identical.",variant:"destructive"});return}if(o.length<8){a({title:"Password too short",description:"Password must be at least 8 characters long.",variant:"destructive"});return}t.mutate({token:n,password:o})};return n?e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-orange-50 to-white flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx(l,{href:"/login",children:e.jsxs("a",{className:"inline-flex items-center gap-2 text-gray-600 hover:text-orange-600 transition-colors mb-4",children:[e.jsx(x,{className:"h-4 w-4"}),"Back to login"]})}),e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[e.jsx("img",{src:u,alt:"Boom Bam",className:"h-12 w-12 object-contain"}),e.jsx("span",{className:"text-3xl font-bold text-orange-600",children:"Boom Bam"})]}),e.jsx("p",{className:"text-gray-600",children:"Create your new password"})]}),e.jsxs(w,{children:[e.jsxs(p,{children:[e.jsx(g,{className:"text-2xl",children:"Reset your password"}),e.jsx(I,{children:m?"Your password has been successfully reset.":"Enter your new password below."})]}),e.jsx(j,{children:m?e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto",children:e.jsx(z,{className:"h-8 w-8 text-green-600"})}),e.jsx("p",{className:"text-gray-600",children:"Your password has been successfully updated! You can now login with your new password."}),e.jsx(i,{onClick:()=>E("/login"),className:"w-full bg-orange-600 hover:bg-orange-700",children:"Go to Login"})]}):e.jsxs("form",{onSubmit:T,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"password",children:"New Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(y,{id:"password",type:c?"text":"password",placeholder:"••••••••",value:o,onChange:s=>k(s),required:!0,disabled:t.isPending,className:"pr-10"}),e.jsx(i,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>L(!c),disabled:t.isPending,children:c?e.jsx(P,{className:"h-4 w-4 text-gray-500"}):e.jsx(C,{className:"h-4 w-4 text-gray-500"})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"confirmPassword",children:"Confirm New Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(y,{id:"confirmPassword",type:d?"text":"password",placeholder:"••••••••",value:h,onChange:s=>B(s),required:!0,disabled:t.isPending,className:"pr-10"}),e.jsx(i,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>S(!d),disabled:t.isPending,children:d?e.jsx(P,{className:"h-4 w-4 text-gray-500"}):e.jsx(C,{className:"h-4 w-4 text-gray-500"})})]})]}),e.jsx(f,{children:e.jsx(b,{children:"Password must be at least 8 characters long and contain a mix of letters, numbers, and symbols for security."})}),e.jsx(i,{type:"submit",className:"w-full bg-orange-600 hover:bg-orange-700",disabled:t.isPending,children:t.isPending?"Upd
1ating Password...":"Update Password"})]})}),!m&&e.jsx(v,{className:"flex flex-col space-y-2",children:e.jsxs("div",{className:"text-center text-sm text-gray-600",children:["Remember your password?"," ",e.jsx(l,{href:"/login",children:e.jsx("a",{className:"text-orange-600 hover:text-orange-700 font-medium",children:"Login"})})]})})]})]})}):e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-orange-50 to-white flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx(l,{href:"/login",children:e.jsxs("a",{className:"inline-flex items-center gap-2 text-gray-600 hover:text-orange-600 transition-colors mb-4",children:[e.jsx(x,{className:"h-4 w-4"}),"Back to login"]})}),e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[e.jsx("img",{src:u,alt:"Boom Bam",className:"h-12 w-12 object-contain"}),e.jsx("span",{className:"text-3xl font-bold text-orange-600",children:"Boom Bam"})]})]}),e.jsxs(w,{children:[e.jsx(p,{children:e.jsx(g,{className:"text-2xl text-center",children:"Invalid Reset Link"})}),e.jsx(j,{children:e.jsxs(f,{variant:"destructive",children:[e.jsx(A,{className:"h-4 w-4"}),e.jsx(b,{children:"This password reset link is invalid or has expired. Please request a new password reset from the login page."})]})}),e.jsx(v,{children:e.jsx(l,{href:"/forgot-password",className:"w-full",children:e.jsx(i,{className:"w-full bg-orange-600 hover:bg-orange-700",children:"Request New Reset Link"})})})]})]})})}export{G 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.