PageSourceSearch

https://dashboard.mphelper.com.ua/assets/ResetPassword-B7nWU1Pm.js

js mphelper.com.ua collected 2026-10-02 02:09:21 UTC 2,724 bytes, 2 lines download raw bytes

1import{o as A,r,j as s,as as P,a6 as N}from"./vendor-BVgZHX98.js";import{L as b}from"./react-router-gNCewEo-.js";import{a as k}from"./axios-DcNlVx-A.js";import{n as F,g as L,e as p,o as m,p as h,q as f,A as B}from"./index-DVXlwtlI.js";function Z(){const{token:x}=A(),[l,i]=r.useState(!1),[c,d]=r.useState(null),[j,w]=r.useState(!1),[t,g]=r.useState(""),[a,y]=r.useState(""),[S,u]=r.useState(null),[E,o]=r.useState(null);function M(e){return e?e.length>=8&&/[A-Za-z]/.test(e)&&/\d/.test(e)&&/[^A-Za-z0-9]/.test(e)?null:"Використовуйте 8+ символів з літерами, цифрами та спеціальними знаками":"Пароль є обов'язковим"}async function v(e){e.preventDefault(),u(null),o(null),d(null);const n=M(t);if(n){u(n);return}if(!a){o("Підтвердіть пароль.");return}if(t!==a){o("Паролі не збігаються");return}i(!0);try{await k.post(`${B}/api/v1/auth/password-reset/confirm/`,{token:x,password:t}),w(!0),N.success("Пароль успішно змінено. Тепер можете увійти.")}catch(C){d(C?.response?.data?.detail||"Не вдалося скинути пароль. Можливо, посилання недійсне або прострочене.")}finally{i(!1)}}return s.jsxs(s.Fragment,{children:[s.jsx(P,{richColors:!0}),s.jsx(F,{title:"Новий пароль",description:"Створіть сильний пароль для безпечного доступу до робочої панелі.",children:s.jsxs("div",{className:"space-y-5",children:[c?s.jsx(L,{title:"Не вдалося змінити пароль",tone:"danger",children:c}):null,j?s.jsx(p,{asChild:!0,variant:"primary",className:"w-full",children:s.jsx(b,{to:"/login",children:"Перейти до входу"})}):s.jsxs("form",{className:"space-y-4",onSubmit:v,noValidate:!0,children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(m,{htmlFor:"password",children:"Новий пароль"}),s.jsx(h,{id:"password",type:"password",autoComplete:"new-password",placeholder:"8+ символів, цифра і спецсимвол",value:t,onChange:e=>g(e.target.value)}),s.jsx(f,{children:S})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(m,{htmlFor:"confirm",children:"Підтвердіть пароль"}),s.jsx(h,{id:"confirm",type:"password",autoComplete:"new-password",placeholder:"Повторіть пароль",value:a,onChange:e=>y(e.target.value)}),s.jsx(f,{children:E})]}),s.jsx(p,{type:"submit",variant:"primary",className:"w-full",disabled:l,children:l?"Змінюємо пароль...":"Змінити пароль"})]})]})})]})}export{Z as default};
2//# sourceMappingURL=ResetPassword-B7nWU1Pm.js.map

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.