PageSourceSearch

https://edgemxtiming.com/assets/OrgForgotPassword-C3gArGU5.js

js edgemxtiming.com collected 2026-10-02 01:31:32 UTC 4,306 bytes, 1 lines download raw bytes

1import{K as k,P as S,r,bo as E,j as e,d as f,L as g,bq as C,m as L,n as B,B as p,b as F,I as P,s as T}from"./index-Ct8eLu1I.js";import{u as z}from"./useOrganizationSlug-Im1jCHRI.js";import{M as _}from"./mail-BgXQiqCk.js";import{C as A}from"./circle-check-big-B2qMybdU.js";import{A as O}from"./arrow-left-xu1INuH2.js";import{o as R,s as $}from"./types-3c7sL9OC.js";const I=R({email:$().email("Invalid email address")}),U=()=>{const{orgSlug:t}=k(),{toast:i}=S(),[a,j]=r.useState(""),[o,l]=r.useState(!1),[N,c]=r.useState(!1),{data:m,isLoading:y}=z(t),{branding:s,setOrganizationFromSlug:d}=E();r.useEffect(()=>{t&&d(t)},[t,d]);const v=async n=>{n.preventDefault();const u=I.safeParse({email:a});if(!u.success){i({title:"Validation Error",description:u.error.errors[0].message,variant:"destructive"});return}l(!0);const{error:h}=await T.auth.resetPasswordForEmail(a,{redirectTo:`${window.location.origin}/reset-password`});l(!1),h?i({title:"Error",description:h.message,variant:"destructive"}):(c(!0),i({title:"Email Sent",description:"Check your inbox for the password reset link."}))};if(y)return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(f,{className:"h-8 w-8 animate-spin text-primary"})});if(!m)return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground mb-2",children:"Organization Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"The organization you're looking for doesn't exist."}),e.jsx(g,{to:`/org/${t}`,className:"text-primary hover:underline",children:"Return to Home"})]})});const b=(s==null?void 0:s.name)||m.name,x=s==null?void 0:s.favicon_url,w=`/org/${t}/login`;return e.jsx(C,{children:e.jsxs("section",{className:"min-h-screen flex items-center justify-center py-12 bg-background",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,hsl(var(--primary)/0.1),transparent_70%)]"}),e.jsx("div",{className:"container mx-auto px-4 relative z-10",children:e.jsxs("div",{className:"max-w-md mx-auto",children:[e.jsxs("div",{className:"text-center mb-8",children:[x?e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-xl mb-4 overflow-hidden",children:e.jsx("img",{src:x,alt:`${b} Icon`,className:"h-16 w-16 object-contain"})}):e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-primary rounded-xl mb-4",children:e.jsx(_,{className:"h-8 w-8 text-primary-foreground"})}),e.jsx("h1",{className:"font-display text-3xl text-foreground",style:{fontFamily:s!=null&&s.font_heading?`"${s.font_heading}", sans-serif`:void 0},children:"RESET PASSWORD"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"Enter your email to receive a password reset link"})]}),e.jsx(L,{className:"bg-card border-border",children:e.jsx(B,{className:"pt-6",children:N?e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx(A,{className:"h-16 w-16 text-green-500 mx-auto"}),e.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"Check Your Email"}),e.jsxs("p",{className:"text-muted-foreground",children:["We've sent a password reset link to ",e.jsx("strong",{children:a}),". Click the link in the email to reset your password."]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Didn't receive the email? Check your spam folder or try again."}),e.jsx(p,{variant:"outline",onClick:()=>c(!1),className:"mt-4",children:"Try Again"})]}):e.jsxs("form",{onSubmit:v,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"email",children:"Email Address"}),e.jsx(P,{id:"email",type:"email",placeholder:"[email protected]",value:a,onChange:n=>j(n.target.value),required:!0})]}),e.jsx(p,{type:"submit",className:"w-full",disabled:o,children:o?e.jsxs(e.Fragment,{children:[e.jsx(f,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):"Send Reset Link"})]})})}),e.jsx("p",{className:"text-center text-sm text-muted-foreground mt-4",children:e.jsxs(g,{to:w,className:"text-primary hover:underline inline-flex items-center gap-1",children:[e.jsx(O,{className:"h-4 w-4"}),"Back to Login"]})})]})})]})})};export{U 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.