veza/apps/web/dist_verification/assets/usePasswordReset-0vtOXL17.js

2 lines
514 B
JavaScript
Raw Normal View History

import{a as l}from"./vendor-react-yWUy5XPk.js";import{a as n}from"./index-CYK_b1Uz.js";function R(){const[o,s]=l.useState(!1),[u,t]=l.useState(null),[c,e]=l.useState(!1);return{handleRequestReset:async a=>{try{s(!0),t(null),e(!1),await n.requestPasswordReset({email:a.email}),e(!0)}catch(r){t(r),e(!1)}finally{s(!1)}},handleReset:async a=>{try{s(!0),t(null),e(!1),await n.resetPassword({token:a.token,new_password:a.password}),e(!0)}catch(r){t(r),e(!1)}finally{s(!1)}},loading:o,error:u,success:c}}export{R as u};