PageSourceSearch

https://enthub.it/build/assets/TwoFactorAuth-X0nSgg2s.js

js enthub.it collected 2026-09-25 04:23:35 UTC 3,523 bytes, 2 lines download raw bytes

1import{_ as e,a}from"./CardContent.vue_vue_type_script_setup_true_lang-Bg7jYQae.js";import{B as s,l as t,v as o,x as l,y as r}from"./app-BwiOD-xT.js";import{i as n,aN as u,aO as d,o as p,j as i,u as c,aP as _,F as f,w as m,k as y,aQ as g,aR as v,aS as b,K as h,r as j,aD as x,x as B,z as C,y as w,q as V,N as P,p as k,V as I,W as O,n as q,a as z}from"./vendor-eWDfdwlh.js";import{_ as A}from"./CardHeader.vue_vue_type_script_setup_true_lang-B5Vbsyb2.js";import{_ as D}from"./CardDescription.vue_vue_type_script_setup_true_lang-DAWsKKFd.js";/* empty css            */import"./media-vendor-aRMZHiv3.js";const E=n({__name:"PinInput",props:{modelValue:{default:()=>[]},defaultValue:{},placeholder:{},mask:{type:Boolean},otp:{type:Boolean},type:{},dir:{},disabled:{type:Boolean},id:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},emits:["update:modelValue","complete"],setup(e,{emit:a}){const t=e,o=a,l=u(t,"class"),r=d(l,o);return(e,a)=>(p(),i(c(_),f(c(r),{class:c(s)("flex gap-2 items-center",t.class)}),{default:m(()=>[y(e.$slots,"default")]),_:3},16,["class"]))}}),F=n({__name:"PinInputGroup",props:{asChild:{type:Boolean},as:{},class:{}},setup(e){const a=e,t=u(a,"class"),o=g(t);return(e,t)=>(p(),i(c(v),f(c(o),{class:c(s)("flex items-center",a.class)}),{default:m(()=>[y(e.$slots,"default")]),_:3},16,["class"]))}}),N=n({__name:"PinInputInput",props:{index:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(e){const a=e,t=u(a,"class"),o=g(t);return(e,t)=>(p(),i(c(b),f(c(o),{class:c(s)("relative text-center focus:outline-none focus:ring-2 focus:ring-ring focus:relative focus:z-10 flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",a.class)}),null,16,["class"]))}}),S={class:"grid gap-6"},T={class:"grid gap-4"},W={__name:"TwoFactorAuth",setup(s){const n=h(),u=j([]),d=j(!1),_=x({}),f=x({otp_code:""}),y=async()=>{f.otp_code=u.value.join(""),d.value=!0,Object.keys(_).forEach(e=>delete _[e]);try{await z.post(route("login.2fa.store"),{...f}),(()=>{const e=n.query.redirect;window.location.href="string"==typeof e&&e.startsWith("/")?e:"/"})()}catch(e){e.response?.data?.errors&&Object.assign(_,e.response.data.errors),f.otp_code=""}finally{d.value=!1}};return(s,n)=>{const g=D,v=A,b=o,h=N,j=F,x=E,z=l,W=r,$=e,G=a;return p(),i(G,null,{default:m(()=>[B(v,{class:"text-center"},{default:m(()=>[B(g,null,{default:m(()=>[C(w(("__"in s?s.__:c(t))("Please confirm access to your account by entering the authentication code provided by your Authenticator app.")),1)]),_:1})]),_:1}),B($,null,{default:m(()=>[V("form",{onSubmit:P(y,["prevent"])},[V("div",S,[V("div",T,[B(b,{for:"otp_code"},{default:m(()=>[C(w(("__"in s?s.__:c(t))("Enter the OTP code")),1)]),_:1}),B(x,{id:"pin-input",modelValue:u.value,"onUpdate:modelValue":[n[0]||(n[0]=e=>u.value=e),n[1]||(n[1]=e=>f.otp_code=e.length<6?"":e)],otp:"",type:"number"},{default:m(()=>[B(j,{class:"gap-1 lg:gap-4 w-full justify-around"},{default:m(()=>[(p(),k(I,null,O(6,(e,a)=>B(h,{key:e,class:"rounded-md border bg-background",index:a,autofocus:0===a},null,8,["index","autofocus"])),64))]),_:1})]),_:1},8,["modelValue"]),B(z,{message:_.otp_code},null,8,["message"])]),B(W,{type:"submit",class:q({"opacity-25":d.value}),disabled:d.value||!f.otp_code},{default:m(()=>[C(w(("__"in s?s.__:c(t))("Confirm")),1)]),_:1},8,["class","disabled"])])],32)]),_:1})]),_:1})}}};export{W as default};
2//# sourceMappingURL=TwoFactorAuth-X0nSgg2s.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.