2 lines
2.0 KiB
JavaScript
2 lines
2.0 KiB
JavaScript
import{_ as g,q as b,r as t,o as k,s as x,i as m,w as s,v as C,g as p,d as a,k as i,h as R,j as N,e as l,t as S,V as h,l as q}from"./index-QAlcqU00.js";import{r as f,p as B,c as F}from"./validators-BsFa-KD7.js";import{V as T}from"./VContainer-DnjqAjRY.js";import{V as j,a as A,b as I,c as M,e as U,f as w,g as z}from"./VTextField-BNQ_nyd-.js";const D={__name:"ResetPasswordView",setup(E){const v=x(),V=C(),_=b(),{success:y}=q(),o=t({password:"",confirmPassword:""}),u=t(!1),r=t(null),d=t(""),P=async()=>{try{u.value=!0,r.value=null,await _.resetPassword(d.value,o.value.password),y("Password reset successfully!"),V.push("/login")}catch(c){r.value=c.message||"Failed to reset password"}finally{u.value=!1}};return k(()=>{d.value=v.query.token||"",d.value||(r.value="Invalid reset token")}),(c,e)=>(p(),m(T,{fluid:"",class:"fill-height"},{default:s(()=>[a(j,{justify:"center",align:"center"},{default:s(()=>[a(A,{cols:"12",sm:"8",md:"6",lg:"4"},{default:s(()=>[a(I,{class:"pa-6"},{default:s(()=>[a(M,{class:"text-center text-h4 mb-6"},{default:s(()=>e[2]||(e[2]=[i(" Set New Password ",-1)])),_:1,__:[2]}),a(U,{onSubmit:R(P,["prevent"])},{default:s(()=>[a(w,{modelValue:o.value.password,"onUpdate:modelValue":e[0]||(e[0]=n=>o.value.password=n),label:"New Password",type:"password","prepend-inner-icon":"mdi-lock",rules:[l(f),l(B)],variant:"outlined",class:"mb-3"},null,8,["modelValue","rules"]),a(w,{modelValue:o.value.confirmPassword,"onUpdate:modelValue":e[1]||(e[1]=n=>o.value.confirmPassword=n),label:"Confirm Password",type:"password","prepend-inner-icon":"mdi-lock",rules:[l(f),l(F)(o.value.password)],variant:"outlined",class:"mb-3"},null,8,["modelValue","rules"]),r.value?(p(),m(z,{key:0,type:"error",class:"mb-4"},{default:s(()=>[i(S(r.value),1)]),_:1})):N("",!0),a(h,{type:"submit",color:"primary",size:"large",block:"",loading:u.value,class:"mb-4"},{default:s(()=>e[3]||(e[3]=[i(" Reset Password ",-1)])),_:1,__:[3]},8,["loading"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}))}},L=g(D,[["__scopeId","data-v-d769999f"]]);export{L as default};
|