PageSourceSearch

https://reivaultpro.com/assets/AdminForgotPasswordPage-BNyMojVp.js

js reivaultpro.com collected 2026-10-09 22:19:22 UTC 5,146 bytes, 1 lines download raw bytes

1import{r,j as e,g as p,w as b,L as c,A as m,Y as w,y as x}from"./index-D-ZsJRgs.js";import{M as j}from"./mail-VD44J7oa.js";import{C as N}from"./circle-alert-DQgE_1Vd.js";function S(){const[t,u]=r.useState(""),[a,d]=r.useState(!1),[h,g]=r.useState(!1),[n,l]=r.useState("");async function f(s){s.preventDefault();const o=t.trim();if(!o){l("Please enter your email address.");return}l(""),d(!0);const{error:i}=await x.auth.resetPasswordForEmail(o,{redirectTo:`${window.location.origin}/admin/reset-password`});if(i){l(i.message);try{await x.from("admin_error_log").insert({error_type:"ADMIN_PASSWORD_RESET_EMAIL_FAILED",error_message:i.message,metadata:{email:o,timestamp:new Date().toISOString()},request_url:"/admin/forgot-password"})}catch{}}else g(!0);d(!1)}return e.jsxs("div",{className:"min-h-screen bg-dark-950 flex flex-col items-center justify-center px-4",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[e.jsx("div",{className:"absolute -top-40 -right-40 w-96 h-96 bg-gold-400/5 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute -bottom-40 -left-40 w-96 h-96 bg-primary-600/5 rounded-full blur-3xl"})]}),e.jsxs("div",{className:"relative w-full max-w-md",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-gradient-to-br from-gold-400 to-gold-600 shadow-lg shadow-gold-400/20 mb-4",children:e.jsx(p,{className:"w-8 h-8 text-white"})}),e.jsx("h1",{className:"text-2xl font-bold text-white tracking-tight",children:"Reset Admin Password"}),e.jsx("p",{className:"text-dark-400 text-sm mt-1",children:"Enter your admin email to receive a reset link"})]}),e.jsx("div",{className:"bg-dark-900 border border-dark-700 rounded-2xl p-8 shadow-2xl",children:h?e.jsxs("div",{className:"text-center py-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-full bg-success-500/15 border border-success-500/30 flex items-center justify-center mx-auto mb-4",children:e.jsx(b,{className:"w-7 h-7 text-success-400"})}),e.jsx("h2",{className:"text-lg font-bold text-white mb-2",children:"Check Your Inbox"}),e.jsxs("p",{className:"text-dark-400 text-sm mb-6 leading-relaxed",children:["A password reset link was sent to"," ",e.jsx("span",{className:"text-white font-semibold",children:t}),". Click the link in the email to set a new password."]}),e.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-xl px-4 py-3 mb-5 text-left",children:[e.jsx("p",{className:"text-xs text-dark-500 mb-1.5",children:"What to expect:"}),e.jsx("ul",{className:"space-y-1.5",children:["Check spam/junk if you do not see it","Link expires after 1 hour","You will land on a secure password-change page","After reset, you will be redirected to admin login"].map(s=>e.jsxs("li",{className:"flex items-center gap-2 text-xs text-dark-300",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-gold-400/60 flex-shrink-0"}),s]},s))})]}),e.jsxs(c,{to:"/admin/login",className:"w-full flex items-center justify-center gap-2 py-3 px-4 bg-gradient-to-r from-gold-500 to-gold-600 text-white font-semibold rounded-xl text-sm hover:from-gold-400 hover:to-gold-500 transition-all",children:["Back to Admin Login ",e.jsx(m,{className:"w-4 h-4"})]})]}):e.jsxs("form",{onSubmit:f,className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-dark-200 mb-1.5",children:"Admin Email Address"}),e.jsxs("div",{className:"relative",children:[e.jsx(j,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-dark-500"}),e.jsx("input",{type:"email",value:t,onChange:s=>u(s.target.value),placeholder:"[email protected]",autoComplete:"email",autoCapitalize:"none",spellCheck:!1,required:!0,autoFocus:!0,disabled:a,className:"w-full pl-10 pr-4 py-3 bg-dark-800 border border-dark-600 rounded-xl text-white placeholder-dark-500 text-sm focus:outline-none focus:ring-2 focus:ring-gold-400/50 focus:border-gold-400/50 transition-all disabled:opacity-50"})]})]}),n&&e.jsxs("div",{className:"flex items-start gap-2.5 bg-error-950/60 border border-error-800/60 rounded-xl px-4 py-3",children:[e.jsx(N,{className:"w-4 h-4 text-error-400 flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-sm text-error-300",children:n})]}),e.jsx("button",{type:"submit",disabled:a||!t.trim(),className:"w-full flex items-center justify-center gap-2 py-3 px-4 bg-gradient-to-r from-gold-500 to-gold-600 text-white font-semibold rounded-xl text-sm hover:from-gold-400 hover:to-gold-500 transition-all focus:outline-none focus:ring-2 focus:ring-gold-400/50 disabled:opacity-50 disabled:cursor-not-allowed shadow-lg shadow-gold-400/20",children:a?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"w-4 h-4 animate-spin"})," Sending Reset Link..."]}):e.jsxs(e.Fragment,{children:["Send Reset Link ",e.jsx(m,{className:"w-4 h-4"})]})}),e.jsxs("p",{className:"text-center text-xs text-dark-500",children:["Remembered your password?"," ",e.jsx(c,{to:"/admin/login",className:"text-gold-400/80 hover:text-gold-400 transition-colors",children:"Back to login"})]})]})})]})]})}export{S 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.