2024-10-27 07:35:17 +01:00
|
|
|
import{u as h,b as _,d as b,H as s,e as a,f as y,k as F,p as v,h as B,m as r,i as t,C as g}from"./app-ClFPZZ4l.js";import{F as C}from"./Form-BU_UekyP.js";/*! 2FAuth version 5.3.2 - Copyright (c) 2024 Bubka - https://github.com/Bubka/2FAuth */const E={__name:"Edit",props:{credentialId:{type:String,default:""}},setup(i){const u=h(),m=_(),e=b(new C({name:s("auth.webauthn.my_device")})),d=i;function c(){e.patch("/webauthn/credentials/"+d.credentialId+"/name").then(()=>{m.success({text:s("auth.webauthn.device_successfully_registered")}),u.push({name:"settings.webauthn.devices"})})}return(l,n)=>{const p=a("FormField"),f=a("FormButtons"),w=a("FormWrapper");return y(),F(w,{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"])],32)]),_:1})}}};export{E as default};
|