2FAuth/public/build/assets/Edit-307bbb3b.js

2 lines
1.2 KiB
JavaScript

import{u as h,b as w,d as b,I as a,e as s,f as y,k as F,p as v,h as B,m as r,i as t,D as g}from"./app-2d89b28f.js";import{F as V}from"./Form-5283f7b6.js";/*! 2FAuth version 5.1.1 - Copyright (c) 2023 Bubka - https://github.com/Bubka/2FAuth */const C=["onSubmit"],I={__name:"Edit",props:{credentialId:{type:String,default:""}},setup(i){const u=i,m=h(),d=w(),e=b(new V({name:a("auth.webauthn.my_device")}));function c(){e.patch("/webauthn/credentials/"+u.credentialId+"/name").then(()=>{d.success({text:a("auth.webauthn.device_successfully_registered")}),m.push({name:"settings.webauthn.devices"})})}return(l,n)=>{const p=s("FormField"),f=s("FormButtons"),_=s("FormWrapper");return y(),F(_,{title:"auth.webauthn.rename_device"},{default:v(()=>[B("form",{onSubmit:g(c,["prevent"]),onKeydown:n[1]||(n[1]=o=>t(e).onKeydown(o))},[r(p,{modelValue:t(e).name,"onUpdate:modelValue":n[0]||(n[0]=o=>t(e).name=o),fieldName:"name",fieldError:t(e).errors.get("name"),inputType:"text",label:"commons.new_name",autofocus:""},null,8,["modelValue","fieldError"]),r(f,{submitId:"btnEditCredential",isBusy:t(e).isBusy,caption:l.$t("commons.save"),showCancelButton:!0,cancelLandingView:"settings.webauthn.devices"},null,8,["isBusy","caption"])],40,C)]),_:1})}}};export{I as default};