PageSourceSearch

https://accounts.lettering.com/build/assets/TwoFactorAuthenticationForm-DENyEk1X.js

js lettering.com collected 2026-10-06 16:55:58 UTC 7,259 bytes, 1 lines download raw bytes

1import{r as v,C as H,d as n,o as t,a as u,b as r,i as N,w as o,g as l,n as b,t as C,y as B,Q,u as Y,v as D,s as I,j as U,c as g,e as m,f as V,F as j,h as z,q as R}from"./app-CImSBo07.js";import{_ as G}from"./ActionSection-BkYwxJzw.js";import{_ as P}from"./Button-D9_Apt3i.js";import{_ as O}from"./DialogModal-7FuRM4R7.js";import{_ as q}from"./Input-Bl9N77dQ.js";import{_ as L}from"./InputError-D3i_DWSZ.js";import{_ as S}from"./SecondaryButton-DlYnI03q.js";import{_ as W}from"./DangerButton-DMtalZIH.js";import{_ as J}from"./Label-BE3q0Bqw.js";import"./SectionTitle-J1ucitxY.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Modal-C8nJqEBB.js";const X={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:T}){const c=T,a=v(!1),s=H({password:"",error:"",processing:!1}),f=v(null),y=()=>{axios.get(route("password.confirmation")).then(i=>{i.data.confirmed?c("confirmed"):(a.value=!0,setTimeout(()=>f.value.focus(),250))})},p=()=>{s.processing=!0,axios.post(route("password.confirm"),{password:s.password}).then(()=>{s.processing=!1,d(),Q().then(()=>c("confirmed"))}).catch(i=>{s.processing=!1,s.error=i.response.data.errors.password[0],f.value.focus()})},d=()=>{a.value=!1,s.password="",s.error=""};return(i,w)=>(t(),n("span",null,[u("span",{onClick:y},[N(i.$slots,"default")]),r(O,{show:a.value,onClose:d},{title:o(()=>[l(C(x.title),1)]),content:o(()=>[l(C(x.content)+" ",1),u("div",X,[r(q,{ref_key:"passwordInput",ref:f,modelValue:s.password,"onUpdate:modelValue":w[0]||(w[0]=F=>s.password=F),type:"password",class:"mt-1 block w-3/4",placeholder:"Password",onKeyup:B(p,["enter"])},null,8,["modelValue"]),r(L,{message:s.error,class:"mt-2"},null,8,["message"])])]),footer:o(()=>[r(S,{onClick:d},{default:o(()=>[...w[1]||(w[1]=[l(" Cancel ",-1)])]),_:1}),r(P,{class:b(["ml-3",{"opacity-25":s.processing}]),disabled:s.processing,onClick:p},{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"},ee={key:1,class:"text-lg font-medium text-gray-900"},te={key:2,class:"text-lg font-medium text-gray-900"},oe={key:3},se={key:0},ae={class:"mt-4 max-w-xl text-sm text-gray-600"},ne={key:0,class:"font-semibold"},re={key:1},le=["innerHTML"],ie={key:0,class:"mt-4 max-w-xl text-sm text-gray-600"},ue={class:"font-semibold"},ce=["innerHTML"],de={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 rounded-lg"},pe={class:""},ve={key:0},ye={key:1},Ve={__name:"TwoFactorAuthenticationForm",props:{requiresConfirmation:Boolean},setup(x){const T=x,c=v(!1),a=v(!1),s=v(!1),f=v(null),y=v(null),p=v([]),d=Y({code:""}),i=D(()=>!c.value&&I().props.user?.two_factor_enabled);U(i,()=>{i.value||(d.reset(),d.clearErrors())});const w=()=>{c.value=!0,R.post("/user/two-factor-authentication",{},{preserveScroll:!0,onSuccess:()=>Promise.all([F(),M(),$()]),onFinish:()=>{c.value=!1,a.value=T.requiresConfirmation}})},F=()=>axios.get("/user/two-factor-qr-code").then(_=>{f.value=_.data.svg}),M=()=>axios.get("/user/two-factor-secret-key").then(_=>{y.value=_.data.secretKey}),$=()=>axios.get("/user/two-factor-recovery-codes").then(_=>{p.value=_.data}),A=()=>{d.post("/user/confirmed-two-factor-authentication",{errorBag:"confirmTwoFactorAuthentication",preserveScroll:!0,preserveState:!0,onSuccess:()=>{a.value=!1,f.value=null,y.value=null}})},E=()=>{axios.post("/user/two-factor-recovery-codes").then(()=>$())},K=()=>{s.value=!0,R.delete("/user/two-factor-authentication",{preserveScroll:!0,onSuccess:()=>{s.value=!1,a.value=!1}})};return(_,e)=>(t(),g(G,null,{title:o(()=>[...e[1]||(e[1]=[l(" Two Factor Authentication ",-1)])]),description:o(()=>[...e[2]||(e[2]=[l(" Add additional security to your account using two factor authentication. ",-1)])]),content:o(()=>[i.value&&!a.value?(t(),n("h3",Z," You have enabled two factor authentication. ")):i.value&&a.value?(t(),n("h3",ee," Finish enabling two factor authentication. ")):(t(),n("h3",te," You have not enabled two factor authentication. ")),e[5]||(e[5]=u("div",{class:"mt-3 max-w-xl text-sm text-gray-600"},[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(),n("div",oe,[f.value?(t(),n("div",se,[u("div",ae,[a.value?(t(),n("p",ne," 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(),n("p",re," 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:f.value},null,8,le),y.value?(t(),n("div",ie,[u("p",ue,[e[3]||(e[3]=l(" Setup Key: ",-1)),u("span",{innerHTML:y.value},null,8,ce)])])):m("",!0),a.value?(t(),n("div",de,[r(J,{for:"code",value:"Code"}),r(q,{id:"code",modelValue:V(d).code,"onUpdate:modelValue":e[0]||(e[0]=k=>V(d).code=k),type:"text",name:"code",class:"block mt-1 w-1/2",inputmode:"numeric",autofocus:"",autocomplete:"one-time-code",onKeyup:B(A,["enter"])},null,8,["modelValue"]),r(L,{message:V(d).errors.code,class:"mt-2"},null,8,["message"])])):m("",!0)])):m("",!0),p.value.length>0&&!a.value?(t(),n("div",me,[e[4]||(e[4]=u("div",{class:"mt-4 max-w-xl text-sm text-gray-600"},[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),n(j,null,z(p.value,k=>(t(),n("div",{key:k}
1,C(k),1))),128))])])):m("",!0)])):m("",!0)]),actions:o(()=>[u("div",pe,[i.value?(t(),n("div",ye,[r(h,{onConfirmed:A},{default:o(()=>[a.value?(t(),g(P,{key:0,type:"button",class:b(["mr-3",{"opacity-25":c.value}]),disabled:c.value},{default:o(()=>[...e[7]||(e[7]=[l(" Confirm ",-1)])]),_:1},8,["class","disabled"])):m("",!0)]),_:1}),r(h,{onConfirmed:E},{default:o(()=>[p.value.length>0&&!a.value?(t(),g(S,{key:0,class:"mr-3"},{default:o(()=>[...e[8]||(e[8]=[l(" Regenerate Recovery Codes ",-1)])]),_:1})):m("",!0)]),_:1}),r(h,{onConfirmed:$},{default:o(()=>[p.value.length===0&&!a.value?(t(),g(S,{key:0,class:"mr-3"},{default:o(()=>[...e[9]||(e[9]=[l(" Show Recovery Codes ",-1)])]),_:1})):m("",!0)]),_:1}),r(h,{onConfirmed:K},{default:o(()=>[a.value?(t(),g(S,{key:0,class:b({"opacity-25":s.value}),disabled:s.value},{default:o(()=>[...e[10]||(e[10]=[l(" Cancel ",-1)])]),_:1},8,["class","disabled"])):m("",!0)]),_:1}),r(h,{onConfirmed:K},{default:o(()=>[a.value?m("",!0):(t(),g(W,{key:0,class:b({"opacity-25":s.value}),disabled:s.value},{default:o(()=>[...e[11]||(e[11]=[l(" Disable ",-1)])]),_:1},8,["class","disabled"]))]),_:1})])):(t(),n("div",ve,[r(h,{onConfirmed:w},{default:o(()=>[r(P,{type:"button",class:b({"opacity-25":c.value}),disabled:c.value},{default:o(()=>[...e[6]||(e[6]=[l(" Enable ",-1)])]),_:1},8,["class","disabled"])]),_:1})]))])]),_:1}))}};export{Ve 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.