2 lines
2.2 KiB
JavaScript
2 lines
2.2 KiB
JavaScript
import{C as R,u as C,a8 as $,r as x,af as L,d as N,w as u,M as S,a2 as q,f as t,g as A,h as D,i as r,m as i,j as s,H as M,p,t as m,$ as W}from"./app-dvJP63FL.js";import{F as P}from"./Form-ZbAUhXmz.js";const j={class:"field"},U={__name:"Recover",setup(H){const f=R(),{t:_}=C(),w=S("2fauth"),n=W(),d=A(),c=q(),b=$(w.prefix+"showWebauthnForm",!1),o=x(new P({email:c.query.email,password:"",token:c.query.token,revokeAll:!1}));function h(l){n.clear(),o.post("/webauthn/recover",{returnError:!0}).then(e=>{b.value=!1,d.push({name:"accounts"})}).catch(e=>{e.response.status===401?n.alert({text:_("notification.authentication_failed"),duration:-1}):e.response.status===422?n.alert({text:e.response.data.message,duration:-1}):f.show(e)})}return L(()=>{n.clear()}),(l,e)=>{const v=t("FormCheckbox"),k=t("FormPasswordField"),y=t("RouterLink"),F=t("FormButtons"),g=t("FormWrapper"),V=t("VueFooter"),B=t("StackLayout");return D(),N(B,null,{content:u(()=>[r(g,{title:"heading.account_recovery",punchline:"message.recover_account_instructions"},{default:u(()=>[i("div",null,[i("form",{onSubmit:M(h,["prevent"]),onKeydown:e[3]||(e[3]=a=>s(o).onKeydown(a))},[r(v,{modelValue:s(o).revokeAll,"onUpdate:modelValue":e[0]||(e[0]=a=>s(o).revokeAll=a),fieldName:"revokeAll",label:"field.disable_all_security_devices",help:"field.disable_all_security_devices.help"},null,8,["modelValue"]),r(k,{modelValue:s(o).password,"onUpdate:modelValue":e[1]||(e[1]=a=>s(o).password=a),fieldName:"password",errorMessage:s(o).errors.get("password"),autocomplete:"current-password",showRules:!1,label:"field.current_password",help:"field.current_password.help"},null,8,["modelValue","errorMessage"]),i("div",j,[i("p",null,[p(m(l.$t("message.forgot_your_password"))+" ",1),r(y,{id:"lnkResetPwd",to:{name:"password.request"},class:"is-link","aria-label":l.$t("label.reset_your_password")},{default:u(()=>[p(m(l.$t("link.request_password_reset")),1)]),_:1},8,["aria-label"])])]),r(F,{submitId:"btnRecover",isBusy:s(o).isBusy,isDisabled:s(o).isDisabled,submitLabel:"label.continue",showCancelButton:!0,onCancel:e[2]||(e[2]=a=>s(d).push({name:"login"}))},null,8,["isBusy","isDisabled"])],32)])]),_:1})]),footer:u(()=>[r(V)]),_:1})}}};export{U as default};
|