PageSourceSearch

https://www.mtcxx.com/build/assets/TwoFactorAuthenticationForm-Dh_Hu94i.js

js mtcxx.com collected 2026-10-03 00:57:58 UTC 7,314 bytes, 1 lines download raw bytes

1import{r as y,X as H,o as t,d as r,a as u,m as N,b as n,w as o,f as l,t as C,z as B,n as k,l as Q,T as Y,j as z,C as D,c as _,e as m,u as V,F as I,g as U,Q as j,x as R}from"./app-BXvF3HYt.js";import{_ as G}from"./Modal-CKMeP4zG.js";import{_ as O}from"./DialogModal-BjEH1S11.js";import{_ as L,a as M}from"./TextInput-CN_jo65B.js";import{_ as A}from"./PrimaryButton-D8zZyiff.js";import{_ as T}from"./SecondaryButton-DBGdLAyH.js";import{_ as W}from"./DangerButton-xGqXEFND.js";import{_ as X}from"./InputLabel-DZhBJ_Kg.js";import"./SectionTitle-CU87EiFI.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const J={class:"mt-4"},h={__name:"ConfirmsPassword",props:{title:{type:String,default:"Confirm Password"},content:{type:String,default:"For your security, please confirm your password to continue."},button:{type:String,default:"Confirm"}},emits:["confirmed"],setup(x,{emit:S}){const d=S,a=y(!1),s=H({password:"",error:"",processing:!1}),p=y(null),g=()=>{axios.get(route("password.confirmation")).then(i=>{i.data.confirmed?d("confirmed"):(a.value=!0,setTimeout(()=>p.value.focus(),250))})},v=()=>{s.processing=!0,axios.post(route("password.confirm"),{password:s.password}).then(()=>{s.processing=!1,c(),Q().then(()=>d("confirmed"))}).catch(i=>{s.processing=!1,s.error=i.response.data.errors.password[0],p.value.focus()})},c=()=>{a.value=!1,s.password="",s.error=""};return(i,w)=>(t(),r("span",null,[u("span",{onClick:g},[N(i.$slots,"default")]),n(O,{show:a.value,onClose:c},{title:o(()=>[l(C(x.title),1)]),content:o(()=>[l(C(x.content)+" ",1),u("div",J,[n(L,{ref_key:"passwordInput",ref:p,modelValue:s.password,"onUpdate:modelValue":w[0]||(w[0]=F=>s.password=F),type:"password",class:"mt-1 block w-3/4",placeholder:"Password",autocomplete:"current-password",onKeyup:B(v,["enter"])},null,8,["modelValue"]),n(M,{message:s.error,class:"mt-2"},null,8,["message"])])]),footer:o(()=>[n(T,{onClick:c},{default:o(()=>w[1]||(w[1]=[l(" Cancel ")])),_:1}),n(A,{class:k(["ml-3",{"opacity-25":s.processing}]),disabled:s.processing,onClick:v},{default:o(()=>[l(C(x.button),1)]),_:1},8,["class","disabled"])]),_:1},8,["show"])]))}},Z={key:0,class:"text-lg font-medium text-gray-900 dark:text-gray-100"},ee={key:1,class:"text-lg font-medium text-gray-900 dark:text-gray-100"},te={key:2,class:"text-lg font-medium text-gray-900 dark:text-gray-100"},oe={key:3},se={key:0},ae={class:"mt-4 max-w-xl text-sm text-gray-600 dark:text-gray-400"},re={key:0,class:"font-semibold"},ne={key:1},le=["innerHTML"],ie={key:0,class:"mt-4 max-w-xl text-sm text-gray-600 dark:text-gray-400"},ue={class:"font-semibold"},de=["innerHTML"],ce={key:1,class:"mt-4"},me={key:1},fe={class:"grid gap-1 max-w-xl mt-4 px-4 py-4 font-mono text-sm bg-gray-100 dark:bg-gray-900 rounded-lg"},pe={class:"mt-5"},ve={key:0},ye={key:1},Fe={__name:"TwoFactorAuthenticationForm",props:{requiresConfirmation:Boolean},setup(x){const S=x,d=y(!1),a=y(!1),s=y(!1),p=y(null),g=y(null),v=y([]),c=Y({code:""}),i=z(()=>{var f;return!d.value&&((f=j().props.auth.user)==null?void 0:f.two_factor_enabled)});D(i,()=>{i.value||(c.reset(),c.clearErrors())});const w=()=>{d.value=!0,R.post(route("two-factor.enable"),{},{preserveScroll:!0,onSuccess:()=>Promise.all([F(),q(),$()]),onFinish:()=>{d.value=!1,a.value=S.requiresConfirmation}})},F=()=>axios.get(route("two-factor.qr-code")).then(f=>{p.value=f.data.svg}),q=()=>axios.get(route("two-factor.secret-key")).then(f=>{g.value=f.data.secretKey}),$=()=>axios.get(route("two-factor.recovery-codes")).then(f=>{v.value=f.data}),P=()=>{c.post(route("two-factor.confirm"),{errorBag:"confirmTwoFactorAuthentication",preserveScroll:!0,preserveState:!0,onSuccess:()=>{a.value=!1,p.value=null,g.value=null}})},E=()=>{axios.post(route("two-factor.recovery-codes")).then(()=>$())},K=()=>{s.value=!0,R.delete(route("two-factor.disable"),{preserveScroll:!0,onSuccess:()=>{s.value=!1,a.value=!1}})};return(f,e)=>(t(),_(G,null,{title:o(()=>e[1]||(e[1]=[l(" Two Factor Authentication ")])),description:o(()=>e[2]||(e[2]=[l(" Add additional security to your account using two factor authentication. ")])),content:o(()=>[i.value&&!a.value?(t(),r("h3",Z," You have enabled two factor authentication. ")):i.value&&a.value?(t(),r("h3",ee," Finish enabling two factor authentication. ")):(t(),r("h3",te," You have not enabled two factor authentication. ")),e[11]||(e[11]=u("div",{class:"mt-3 max-w-xl text-sm text-gray-600 dark:text-gray-400"},[u("p",null," When two factor authentication is enabled, you will be prompted for a secure, random token during authentication. You may retrieve this token from your phone's Google Authenticator application. ")],-1)),i.value?(t(),r("div",oe,[p.value?(t(),r("div",se,[u("div",ae,[a.value?(t(),r("p",re," To finish enabling two factor authentication, scan the following QR code using your phone's authenticator application or enter the setup key and provide the generated OTP code. ")):(t(),r("p",ne," Two factor authentication is now enabled. Scan the following QR code using your phone's authenticator application or enter the setup key. "))]),u("div",{class:"mt-4",innerHTML:p.value},null,8,le),g.value?(t(),r("div",ie,[u("p",ue,[e[3]||(e[3]=l(" Setup Key: ")),u("span",{innerHTML:g.value},null,8,de)])])):m("",!0),a.value?(t(),r("div",ce,[n(X,{for:"code",value:"Code"}),n(L,{id:"code",modelValue:V(c).code,"onUpdate:modelValue":e[0]||(e[0]=b=>
1V(c).code=b),type:"text",name:"code",class:"block mt-1 w-1/2",inputmode:"numeric",autofocus:"",autocomplete:"one-time-code",onKeyup:B(P,["enter"])},null,8,["modelValue"]),n(M,{message:V(c).errors.code,class:"mt-2"},null,8,["message"])])):m("",!0)])):m("",!0),v.value.length>0&&!a.value?(t(),r("div",me,[e[4]||(e[4]=u("div",{class:"mt-4 max-w-xl text-sm text-gray-600 dark:text-gray-400"},[u("p",{class:"font-semibold"}," Store these recovery codes in a secure password manager. They can be used to recover access to your account if your two factor authentication device is lost. ")],-1)),u("div",fe,[(t(!0),r(I,null,U(v.value,b=>(t(),r("div",{key:b},C(b),1))),128))])])):m("",!0)])):m("",!0),u("div",pe,[i.value?(t(),r("div",ye,[n(h,{onConfirmed:P},{default:o(()=>[a.value?(t(),_(A,{key:0,type:"button",class:k(["mr-3",{"opacity-25":d.value}]),disabled:d.value},{default:o(()=>e[6]||(e[6]=[l(" Confirm ")])),_:1},8,["class","disabled"])):m("",!0)]),_:1}),n(h,{onConfirmed:E},{default:o(()=>[v.value.length>0&&!a.value?(t(),_(T,{key:0,class:"mr-3"},{default:o(()=>e[7]||(e[7]=[l(" Regenerate Recovery Codes ")])),_:1})):m("",!0)]),_:1}),n(h,{onConfirmed:$},{default:o(()=>[v.value.length===0&&!a.value?(t(),_(T,{key:0,class:"mr-3"},{default:o(()=>e[8]||(e[8]=[l(" Show Recovery Codes ")])),_:1})):m("",!0)]),_:1}),n(h,{onConfirmed:K},{default:o(()=>[a.value?(t(),_(T,{key:0,class:k({"opacity-25":s.value}),disabled:s.value},{default:o(()=>e[9]||(e[9]=[l(" Cancel ")])),_:1},8,["class","disabled"])):m("",!0)]),_:1}),n(h,{onConfirmed:K},{default:o(()=>[a.value?m("",!0):(t(),_(W,{key:0,class:k({"opacity-25":s.value}),disabled:s.value},{default:o(()=>e[10]||(e[10]=[l(" Disable ")])),_:1},8,["class","disabled"]))]),_:1})])):(t(),r("div",ve,[n(h,{onConfirmed:w},{default:o(()=>[n(A,{type:"button",class:k({"opacity-25":d.value}),disabled:d.value},{default:o(()=>e[5]||(e[5]=[l(" Enable ")])),_:1},8,["class","disabled"])]),_:1})]))])]),_:1}))}};export{Fe as default};

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.