PageSourceSearch

https://popuplus.vercel.app/assets/admin.2fa-setup-Duq9wLWU.js

js popuplus.vercel.app collected 2026-10-03 05:50:54 UTC 4,486 bytes, 1 lines download raw bytes

1import{j as e}from"./shop.authorize-IdAWuXfe.js";import{u as s,a as d,F as a}from"./components-DQtfA4Nq.js";import"./index-B-K_ieUt.js";import"./index-lzg1UvrH.js";const t={page:{minHeight:"100vh",background:"#f6f6f7",padding:"40px 24px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"},container:{maxWidth:560,margin:"0 auto"},heading:{fontSize:22,fontWeight:700,marginBottom:4,color:"#1a1a1a"},sub:{fontSize:13,color:"#6d7175",marginBottom:32},box:{background:"#fff",border:"1px solid #e1e3e5",borderRadius:12,padding:"32px"},step:{display:"flex",gap:14,marginBottom:28,alignItems:"flex-start"},num:{width:28,height:28,borderRadius:"50%",background:"#1a1a1a",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:700,flexShrink:0,marginTop:1},stepContent:{flex:1},stepTitle:{fontSize:14,fontWeight:600,marginBottom:4},stepSub:{fontSize:13,color:"#6d7175",lineHeight:1.5},qr:{margin:"16px 0",borderRadius:8,border:"1px solid #e1e3e5",display:"block"},secret:{fontFamily:"monospace",fontSize:14,background:"#f6f6f7",border:"1px solid #e1e3e5",borderRadius:6,padding:"8px 12px",letterSpacing:2,userSelect:"all",marginTop:12,display:"block"},label:{display:"block",fontSize:13,fontWeight:500,color:"#1a1a1a",marginBottom:6,marginTop:16},input:{width:"100%",padding:"9px 12px",fontSize:20,fontWeight:600,letterSpacing:6,border:"1px solid #c9cccf",borderRadius:6,outline:"none",boxSizing:"border-box",textAlign:"center"},btn:{marginTop:16,padding:"10px 24px",fontSize:14,fontWeight:600,background:"#1a1a1a",color:"#fff",border:"none",borderRadius:6,cursor:"pointer"},error:{background:"#fff4f4",border:"1px solid #fca5a5",color:"#b91c1c",borderRadius:6,padding:"10px 14px",fontSize:13,marginTop:14},success:{background:"#e3f5ef",border:"1px solid #6fcf97",borderRadius:8,padding:"20px 24px",marginTop:4},successTitle:{fontSize:15,fontWeight:700,color:"#007a5a",marginBottom:8},envBox:{fontFamily:"monospace",fontSize:13,background:"#f6f6f7",border:"1px solid #e1e3e5",borderRadius:6,padding:"10px 14px",marginTop:10,userSelect:"all",wordBreak:"break-all"},back:{display:"inline-block",marginTop:24,fontSize:13,color:"#5c6ac4",textDecoration:"none"}};function x(){const{secret:o,qrDataUrl:r,configured:n}=s(),i=d();return e.jsx("div",{style:t.page,children:e.jsxs("div",{style:t.container,children:[e.jsx("div",{style:t.heading,children:"Set up two-factor authentication"}),e.jsx("div",{style:t.sub,children:"Use Google Authenticator or any TOTP app to secure your admin login."}),e.jsx("div",{style:t.box,children:i!=null&&i.verified?e.jsxs("div",{style:t.success,children:[e.jsx("div",{style:t.successTitle,children:"✓ Code verified — 2FA is working"}),e.jsxs("p",{style:{fontSize:13,color:"#1a1a1a",margin:"0 0 12px"},children:["Add the following line to your ",e.jsx("code",{children:".env"})," file",n?" (already set)":"",", then restart the server:"]}),e.jsxs("div",{style:t.envBox,children:["ADMIN_TOTP_SECRET=",i.secret]}),e.jsx("p",{style:{fontSize:12,color:"#6d7175",marginTop:10},children:"After restarting, every login will require the 6-digit code from your authenticator app."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:t.step,children:[e.jsx("div",{style:t.num,children:"1"}),e.jsxs("div",{style:t.stepContent,children:[e.jsx("div",{style:t.stepTitle,children:"Scan this QR code"}),e.jsx("div",{style:t.stepSub,children:"Open Google Authenticator → tap + → Scan a QR code"}),e.jsx("img",{src:r,alt:"TOTP QR code",width:180,height:180,style:t.qr}),e.jsx("div",{style:t.stepSub,children:"Can't scan? Enter this secret manually:"}),e.jsx("code",{style:t.secret,children:o})]})]}),e.jsxs("div",{style:t.step,children:[e.jsx("div",{style:t.num,children:"2"}),e.jsxs("div",{style:t.stepContent,children:[e.jsx("div",{style:t.stepTitle,children:"Verify it works"}),e.jsx("div",{style:t.stepSub,children:"Enter the 6-digit code shown in the app to confirm setup."}),(i==null?void 0:i.error)&&e.jsx("div",{style:t.error,children:i.error}),e.jsxs(a,{method:"post",children:[e.jsx("input",{type:"hidden",name:"secret",value:o}),e.jsx("label",{style:t.label,children:"Authentication code"}),e.jsx("input",{name:"code",type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:6,placeholder:"000000",style:t.input}),e.jsx("button",{type:"submit",style:t.btn,children:"Verify code"})]})]})]})]})}),e.jsx("a",{href:"/admin",style:t.back,children:"← Back to admin"})]})})}export{x 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.