PageSourceSearch

https://toguzkumalak.com/assets/ResetPasswordView-6Ey458k1.js

js toguzkumalak.com collected 2026-10-03 02:42:29 UTC 4,251 bytes, 1 lines download raw bytes

1import{r as l,j as e}from"./react-vendor-DVl_j3ZO.js";import{a1 as g,a7 as w,a as y}from"./index-DOARK-DV.js";import{u as k}from"./useLocale-C-pPUmlD.js";import{A as E}from"./AuthLayout-CkjQ8YT_.js";import{B as j}from"./Button-D212SBON.js";import{g as _}from"./authShared-BCmxYdBm.js";import"./preload-helper-BXtGQ0on.js";import"./vendor-D0IlVHJ8.js";import"./state-vendor-B2bKdg16.js";import"./style-utils-vendor-CZ__NpDL.js";import"./ui-vendor-BK1JzGH1.js";import"./framer-vendor-CdZfGxFf.js";import"./radix-vendor--rFHbw22.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new a.Error().stack;d&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[d]="9e807a78-ff27-462e-82c0-409932d87403",a._sentryDebugIdIdentifier="sentry-dbid-9e807a78-ff27-462e-82c0-409932d87403")}catch{}})();const G=({onLogin:a})=>{const[d,h]=l.useState("email"),[n,N]=l.useState(""),[f,v]=l.useState(""),[c,C]=l.useState(""),[m,i]=l.useState(""),[u,r]=l.useState(""),[p,x]=l.useState(!1),b=k(),t=s=>g(w[s],s,b),S=async s=>{if(s.preventDefault(),r(""),i(""),!n){r(t("error_required"));return}x(!0);try{const o=await y("/api/auth/forgot-password",{email:n});i(o?.message||t("reset_email_sent")),h("code")}catch(o){r(_(o,"Failed to send reset code"))}finally{x(!1)}},D=async s=>{if(s.preventDefault(),r(""),i(""),!f||!c){r(t("error_required"));return}if(c.length<8){r(t("password_min_length"));return}x(!0);try{const o=await y("/api/auth/reset-password",{email:n,code:f,new_password:c});i(o?.message||t("password_updated")),setTimeout(a,1500)}catch(o){r(_(o,"Invalid or expired reset code"))}finally{x(!1)}};return e.jsxs(E,{children:[e.jsx("h2",{className:"text-lg font-bold text-white mb-6 text-center",children:t("reset_title")}),d==="email"?e.jsxs("form",{onSubmit:S,className:"space-y-4",noValidate:!0,children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm text-gray-400 mb-1",children:t("email_label")}),e.jsx("input",{type:"email",value:n,onChange:s=>N(s.target.value),className:"w-full h-12 px-4 rounded-md bg-night-slate border border-white/10 text-white placeholder-gray-500 focus:outline-none focus:border-brand transition-colors",autoComplete:"email"})]}),u&&e.jsx("p",{className:"text-error text-sm",children:u}),m&&e.jsx("p",{className:"text-green-400 text-sm",children:m}),e.jsx(j,{type:"submit",className:"w-full",disabled:p,children:p?"...":t("submit_reset")})]}):e.jsxs("form",{onSubmit:D,className:"space-y-4",noValidate:!0,children:[e.jsx("p",{className:"text-sm text-gray-400 text-center mb-2",children:g(w.code_sent_to,`Code sent to ${n}`,b).replace("{{email}}",n)}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm text-gray-400 mb-1",children:t("reset_code_label")}),e.jsx("input",{type:"text",inputMode:"numeric",maxLength:6,value:f,onChange:s=>v(s.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"000000",className:"w-full h-12 px-4 rounded-md bg-night-slate border border-white/10 text-white text-center text-2xl tracking-[0.5em] font-mono placeholder-gray-600 focus:outline-none focus:border-brand transition-colors",autoComplete:"one-time-code"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm text-gray-400 mb-1",children:t("new_password_label")}),e.jsx("input",{type:"password",value:c,onChange:s=>C(s.target.value),className:"w-full h-12 px-4 rounded-md bg-night-slate border border-white/10 text-white placeholder-gray-500 focus:outline-none focus:border-brand transition-colors",autoComplete:"new-password"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:t("password_min_length")})]}),u&&e.jsx("p",{className:"text-error text-sm",children:u}),m&&e.jsx("p",{className:"text-green-400 text-sm",children:m}),e.jsx(j,{type:"submit",className:"w-full",disabled:p,children:p?"...":t("update_password")}),e.jsx("button",{type:"button",onClick:()=>{h("email"),r(""),i("")},className:"w-full text-sm text-gray-500 hover:text-gray-300 transition-colors",children:t("resend_code")})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx("button",{onClick:a,className:"text-sm text-gray-400 hover:text-white transition-colors",children:t("login_title")})})]})};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.