2024-11-17 23:37:23 +01:00
|
|
|
import{a as B,r as b,c as R,a0 as h,h as i,k as c,_ as E,l as s,m as l,e as N,j as d,f as t,i as m,g as C,t as v,C as P,p as L}from"./app-D4Udf6Mm.js";import{F as x}from"./Form-BGrUTood.js";/*! 2FAuth version 5.4.1 - Copyright (c) 2024 Bubka - https://github.com/Bubka/2FAuth */const D={__name:"Reset",setup(S){const a=B();L();const p=E(),u=b(!0),e=R(new x({email:p.query.email,password:"",password_confirmation:"",token:p.query.token}));function f(n){e.password_confirmation=e.password,e.post("/user/password/reset",{returnError:!0}).then(o=>{e.password="",e.password_confirmation="",u.value=!1,a.success({text:o.data.message,duration:-1})}).catch(o=>{o.response.data.resetFailed?a.alert({text:o.response.data.resetFailed,duration:-1}):o.response.status!==422&&a.error(o)})}return h(()=>{a.clear()}),(n,o)=>{const w=s("FormField"),_=s("FormPasswordField"),F=s("FieldError"),k=s("FormButtons"),y=s("RouterLink"),V=s("VueFooter"),g=s("FormWrapper");return l(),i(g,{title:n.$t("auth.forms.new_password")},{default:c(()=>[N("form",{onSubmit:P(f,["prevent"]),onKeydown:o[2]||(o[2]=r=>t(e).onKeydown(r))},[d(w,{modelValue:t(e).email,"onUpdate:modelValue":o[0]||(o[0]=r=>t(e).email=r),isDisabled:!0,fieldName:"email",fieldError:t(e).errors.get("email"),label:"auth.forms.email",autofocus:""},null,8,["modelValue","fieldError"]),d(_,{modelValue:t(e).password,"onUpdate:modelValue":o[1]||(o[1]=r=>t(e).password=r),fieldName:"password",fieldError:t(e).errors.get("password"),autocomplete:"new-password",showRules:!0,label:"auth.forms.new_password"},null,8,["modelValue","fieldError"]),t(e).errors.get("token")!=null?(l(),i(F,{key:0,error:t(e).errors.get("token"),field:t(e).token},null,8,["error","field"])):m("",!0),t(u)?(l(),i(k,{key:1,submitId:"btnResetPwd",isBusy:t(e).isBusy,caption:n.$t("auth.forms.change_password"),showCancelButton:!0,cancelLandingView:"login"},null,8,["isBusy","caption"])):m("",!0),t(u)?m("",!0):(l(),i(y,{key:2,id:"btnContinue",to:{name:"accounts"},class:"button is-link"},{default:c(()=>[C(v(n.$t("commons.continue")),1)]),_:1}))],32),d(V)]),_:1},8,["title"])}}};export{D as default};
|