PageSourceSearch

https://www.wrap-up.ai/assets/reset-password-DekwxMDk.js

js wrap-up.ai collected 2026-10-05 13:18:30 UTC 6,592 bytes, 6 lines download raw bytes

1import{c as B,u as O,r as t,j as e,L as d,e as Y}from"./index-B7Esrfq-.js";import{u as U}from"./useMutation-GpyYneN8.js";import{u as K,F as V,a as y,b,c as v,d as P,e as S,t as W,o as z,s as k}from"./form-CQ-omCm5.js";import{B as l}from"./button-CL7L0UQ-.js";import{I as m}from"./input-MulFogVX.js";import{C as x}from"./card-XS4BSNp9.js";import{C as E}from"./circle-check-B95JLTS5.js";import{A as R}from"./arrow-left-bEzmlWAK.js";import{M as D}from"./mail-TKdrXGoW.js";import{C as G}from"./car-aX78SQej.js";import{E as J,a as H}from"./eye-BIlma6HH.js";/**
2 * @license lucide-react v0.453.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const C=B("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),Q=z({password:k().min(6,"Password must be at least 6 characters"),confirmPassword:k().min(1,"Please confirm your password")}).refine(r=>r.password===r.confirmPassword,{message:"Passwords don't match",path:["confirmPassword"]});function le(){const{toast:r}=O(),h=new URLSearchParams(window.location.search),u=h.get("token")||"",p=h.get("email")||"",[c,F]=t.useState(!1),[L,q]=t.useState(!1),[w,I]=t.useState(p),[A,M]=t.useState(!1),[f,j]=t.useState(!1),[N,g]=t.useState(""),o=K({resolver:W(Q),defaultValues:{password:"",confirmPassword:""}}),i=U({mutationFn:async s=>(await Y("POST","/api/reset-password",{token:u,password:s.password})).json(),onSuccess:()=>{q(!0),r({title:"Password reset!",description:"You can now sign in with your new password."})},onError:s=>{r({title:"Reset failed",description:s.message.replace(/^\d+:\s*/,""),variant:"destructive"})}});if(!u){const s=async a=>{a.preventDefault(),j(!0),g("");try{const n=await fetch("/api/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:w})}),T=await n.json();if(!n.ok)throw new Error(T.message);M(!0)}catch(n){g(n.message||"Failed to send reset request")}finally{j(!1)}};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900 p-4",children:e.jsx(x,{className:"w-full max-w-md p-8 bg-slate-800/50 border-slate-700",children:A?e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx(E,{className:"w-12 h-12 text-green-400 mx-auto"}),e.jsx("h2",{className:"text-2xl font-bold text-white",children:"Check Your Email"}),e.jsx("p",{className:"text-slate-300",children:"If an account exists with that email, we've sent a password reset link. Please check your inbox."}),e.jsx(d,{href:"/auth",children:e.jsxs(l,{variant:"outline",className:"mt-4 border-slate-600 text-slate-300 hover:bg-slate-700",children:[e.jsx(R,{className:"w-4 h-4 mr-2"}),"Back to Login"]})})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx(D,{className:"w-12 h-12 text-blue-400 mx-auto"}),e.jsx("h2",{className:"text-2xl font-bold text-white",children:"Forgot Password"}),e.jsx("p",{className:"text-slate-400",children:"Enter your email address and we'll send you a reset link."})]}),e.jsxs("form",{onSubmit:s,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"resetEmail",className:"text-sm font-medium text-slate-300",children:"Email"}),e.jsx(m,{id:"resetEmail",type:"email",placeholder:"Enter your email",value:w,onChange:a=>I(a.target.value),required:!0,className:"bg-slate-700/50 border-slate-600 text-white"})]}),N&&e.jsx("p",{className:"text-sm text-red-400",children:N}),e.jsx(l,{type:"submit",className:"w-full",disabled:f,children:f?"Sending...":"Send Reset Link"})]}),e.jsx("div",{className:"text-center",children:e.jsx(d,{href:"/auth",children:e.jsxs("span",{className:"text-sm text-slate-400 hover:text-white cursor-pointer",children:[e.jsx(R,{className:"w-3 h-3 inline mr-1"}),"Back to Login"]})})})]})})})}return L?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center px-4",children:e.jsxs(x,{className:"w-full max-w-md p-8 text-center space-y-4",children:[e.jsx(E,{className:"w-12 h-12 mx-auto text-green-500"}),e.jsx("h1",{className:"text-xl font-semibold",children:"Password Reset Successful"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your password has been updated. You can now sign in with your new password."}),e.jsx(d,{href:"/",children:e.jsx(l,{className:"w-full",children:"Go to Wrap Up AI"})})]})}):e.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[e.jsx("header",{className:"border-b bg-background/95 backdrop-blur",children:e.jsxs("div",{className:"container flex h-16 items-center gap-2 px-4 mx-auto max-w-5xl",children:[e.jsx(G,{className:"w-6 h-6"}),e.jsx("span",{className:"font-semibold text-lg",children:"Wrap Up AI"})]})}),e.jsx("main",{className:"flex-1 flex items-center justify-center px-4 py-12",children:e.jsxs(x,{className:"w-full max-w-md p-8 space-y-6",children:[e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx(C,{className:"w-10 h-10 mx-auto text-primary"}),e.jsx("h1",{className:"text-2xl font-semibold",children:"Set New Password"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Enter a new password for ",e.jsx("span",{className:"font-medium text-foreground",children:p})]})]}),e.jsx(V,{...o,children:e.jsxs("form",{onSubmit:o.handleSubmit(s=>i.mutate(s)),className:"space-y-4",children:[e.jsx(y,{control:o.control,name:"password",render:({field:s})=>e.jsxs(b,{children:[e.jsx(v,{children:"New Password"}),e.jsx(P,{children:e.jsxs("div",{className:"relative",children:[e.jsx(m,{type:c?"text":"password",placeholder:"At least 6 characters",...s}),e.jsx("button",{type:"button",className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",onClick:()=>F(a=>!a),children:c?e.jsx(J,{className:"w-4 h-4"}):e.jsx(H,{className:"w-4 h-4"})})]})}),e.jsx(S,{})]})}),e.jsx(y,{control:o.control,name:"confirmPassword",render:({field:s})=>e.jsxs(b,{children:[e.jsx(v,{children:"Confirm Password"}),e.jsx(P,{children:e.jsx(m,{type:c?"text":"password",placeholder:"Repeat your password",...s})}),e.jsx(S,{})]})}),e.jsxs(l,{type:"submit",className:"w-full",disabled:i.isPending,children:[e.jsx(C,{className:"w-4 h-4 mr-2"}),i.isPending?"Resetting...":"Reset Password"]})]})})]})})]})}export{le 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.