[{"data":1,"prerenderedAt":316},["ShallowReactive",2],{"docs:navigation":3,"docs:page:\u002Fdocs\u002Fauthentication\u002Ftwo-factor":115},[4],{"title":5,"path":6,"stem":7,"children":8,"icon":10},"Introduction","\u002Fdocs","docs\u002F1.index",[9,11,16,21,38,95,110],{"title":5,"path":6,"stem":7,"icon":10},"i-lucide-house",{"title":12,"path":13,"stem":14,"icon":15},"Quickstart","\u002Fdocs\u002Fquickstart","docs\u002F2.quickstart","i-lucide-rocket",{"title":17,"path":18,"stem":19,"icon":20},"Essentials","\u002Fdocs\u002Fconfiguration","docs\u002F3.configuration","i-lucide-book-open",{"title":22,"path":23,"stem":24,"children":25,"icon":27},"Authentication","\u002Fdocs\u002Fauthentication","docs\u002F4.authentication\u002Findex",[26,28,33],{"title":22,"path":23,"stem":24,"icon":27},"i-lucide-shield-check",{"title":29,"path":30,"stem":31,"icon":32},"Protect User Data","\u002Fdocs\u002Fauthentication\u002Fuser-data","docs\u002F4.authentication\u002F1.user-data","i-lucide-user-lock",{"title":34,"path":35,"stem":36,"icon":37},"Two-Factor Verification","\u002Fdocs\u002Fauthentication\u002Ftwo-factor","docs\u002F4.authentication\u002F2.two-factor","i-lucide-key-round",{"title":39,"path":40,"stem":41,"children":42,"icon":44},"Deployment","\u002Fdocs\u002Fdeployment","docs\u002F5.deployment\u002Findex",[43,45,50,55,60,65,70,75,80,85,90],{"title":39,"path":40,"stem":41,"icon":44},"i-lucide-cloud-upload",{"title":46,"path":47,"stem":48,"icon":49},"Deploy to Cloudflare","\u002Fdocs\u002Fdeployment\u002Fcloudflare","docs\u002F5.deployment\u002F1.cloudflare","i-simple-icons-cloudflare",{"title":51,"path":52,"stem":53,"icon":54},"Platform Support","\u002Fdocs\u002Fdeployment\u002Fsupport","docs\u002F5.deployment\u002F10.support","i-lucide-list-checks",{"title":56,"path":57,"stem":58,"icon":59},"Deploy to Vercel","\u002Fdocs\u002Fdeployment\u002Fvercel","docs\u002F5.deployment\u002F2.vercel","i-simple-icons-vercel",{"title":61,"path":62,"stem":63,"icon":64},"Deploy to Azure","\u002Fdocs\u002Fdeployment\u002Fazure","docs\u002F5.deployment\u002F3.azure","i-simple-icons-microsoftazure",{"title":66,"path":67,"stem":68,"icon":69},"Switch Hosts","\u002Fdocs\u002Fdeployment\u002Fswitch-hosts","docs\u002F5.deployment\u002F4.switch-hosts","i-lucide-arrow-right-left",{"title":71,"path":72,"stem":73,"icon":74},"Database and File Storage","\u002Fdocs\u002Fdeployment\u002Fdata-services","docs\u002F5.deployment\u002F5.data-services","i-lucide-database",{"title":76,"path":77,"stem":78,"icon":79},"Domains and Secrets","\u002Fdocs\u002Fdeployment\u002Fsettings","docs\u002F5.deployment\u002F6.settings","i-lucide-settings",{"title":81,"path":82,"stem":83,"icon":84},"Troubleshoot Deployment","\u002Fdocs\u002Fdeployment\u002Ftroubleshooting","docs\u002F5.deployment\u002F7.troubleshooting","i-lucide-wrench",{"title":86,"path":87,"stem":88,"icon":89},"Deploy Agents","\u002Fdocs\u002Fdeployment\u002Fagents","docs\u002F5.deployment\u002F8.agents","i-lucide-bot",{"title":91,"path":92,"stem":93,"icon":94},"Deploy Automations","\u002Fdocs\u002Fdeployment\u002Fautomations","docs\u002F5.deployment\u002F9.automations","i-lucide-workflow",{"title":96,"path":97,"stem":98,"children":99,"icon":101},"Connect Accounts","\u002Fdocs\u002Fconnect","docs\u002F6.connect\u002Findex",[100,102,106],{"title":96,"path":97,"stem":98,"icon":101},"i-lucide-plug",{"title":103,"path":104,"stem":105,"icon":37},"Connection Credentials","\u002Fdocs\u002Fconnect\u002Fcredentials","docs\u002F6.connect\u002F1.credentials",{"title":107,"path":108,"stem":109,"icon":84},"Connect MCP Servers","\u002Fdocs\u002Fconnect\u002Fmcp","docs\u002F6.connect\u002F2.mcp",{"title":111,"path":112,"stem":113,"icon":114},"Project Reference","\u002Fdocs\u002Freference","docs\u002F7.reference","i-lucide-terminal",{"page":116,"surround":311},{"id":117,"title":34,"body":118,"description":304,"extension":305,"links":306,"meta":307,"navigation":308,"path":35,"seo":309,"stem":36,"__hash__":310},"docs\u002Fdocs\u002F4.authentication\u002F2.two-factor.md",{"type":119,"value":120,"toc":298},"minimark",[121,130,135,143,206,224,228,246,250,253,256,260,282,294],[122,123,124,125,129],"p",{},"Dashboard starters include email one-time codes (OTP) and passkey second factors. Users keep\nsigning in with GitHub and choose their second factor in ",[126,127,128],"strong",{},"Settings → Security",".\nCloudConfig enforces verification on the server before completing sign-in.",[131,132,134],"h2",{"id":133},"enable-verification","Enable Verification",[122,136,137,138,142],{},"For an existing app, enable the capability in ",[139,140,141],"code",{},"cloud.config.ts",":",[144,145,150],"pre",{"className":146,"code":147,"language":148,"meta":149,"style":149},"language-ts shiki shiki-themes github-light github-light github-dark","auth: {\n  providers: { github: true },\n  twoFactor: true,\n}\n","ts","",[139,151,152,165,187,200],{"__ignoreMap":149},[153,154,157,161],"span",{"class":155,"line":156},"line",1,[153,158,160],{"class":159},"snPdu","auth",[153,162,164],{"class":163},"sxrX7",": {\n",[153,166,168,171,174,177,180,184],{"class":155,"line":167},2,[153,169,170],{"class":159},"  providers",[153,172,173],{"class":163},": { ",[153,175,176],{"class":159},"github",[153,178,179],{"class":163},": ",[153,181,183],{"class":182},"sBjJW","true",[153,185,186],{"class":163}," },\n",[153,188,190,193,195,197],{"class":155,"line":189},3,[153,191,192],{"class":159},"  twoFactor",[153,194,179],{"class":163},[153,196,183],{"class":182},[153,198,199],{"class":163},",\n",[153,201,203],{"class":155,"line":202},4,[153,204,205],{"class":163},"}\n",[122,207,208,209,212,213,216,217,212,220,223],{},"Install ",[139,210,211],{},"better-auth"," and ",[139,214,215],{},"@better-auth\u002Fpasskey"," version 1.7.7 or newer, then run\n",[139,218,219],{},"pnpm db:generate",[139,221,222],{},"pnpm db:migrate",". CloudConfig owns the extra auth tables;\ndo not run Better Auth's separate migration CLI.",[131,225,227],{"id":226},"deliver-email-codes","Deliver Email Codes",[122,229,230,231,234,235,238,239,212,242,245],{},"OTP delivery uses ",[139,232,233],{},"@dashboardstack\u002Femail",", the shared Cloudflare email service.\nConfigure it with ",[139,236,237],{},"pnpm exec cloudconfig auth email",". This stores\n",[139,240,241],{},"EMAIL_SERVICE_URL",[139,243,244],{},"EMAIL_API_KEY"," in your ignored environment file. Use\nyour project's service key; its registered sender supplies the from address.\nDeployment requires and syncs both values.\nDuring development, a missing sender prints codes to the local server console.\nProduction requires delivery and never logs verification codes.",[131,247,249],{"id":248},"let-users-manage-their-factors","Let Users Manage Their Factors",[122,251,252],{},"Email enrollment requires verifying a code before enabling 2FA. Codes are hashed,\nexpire in five minutes, and allow five attempts.",[122,254,255],{},"Passkeys require a device PIN or biometrics and must belong to the account used\nfor primary sign-in. Users can switch factors, add passkeys, or turn off 2FA after a recent sign-in. They\nmust switch factors or turn off 2FA before removing their last active passkey.",[131,257,259],{"id":258},"build-a-custom-interface","Build a Custom Interface",[122,261,262,263,212,266,269,270,273,274,277,278,281],{},"The Nuxt dashboard template includes ",[139,264,265],{},"settings\u002FTwoFactor.vue",[139,267,268],{},"\u002Ftwo-factor",". Custom\ninterfaces use ",[139,271,272],{},"useCloudConfigTwoFactor()"," for email codes and passkey ceremonies,\nand ",[139,275,276],{},"useCloudConfigAccount().getTwoFactorStatus()"," to read the selected method\nand pending challenge. Set ",[139,279,280],{},"twoFactor: { passkey: false }"," for email only.",[122,283,284,285,288,289,293],{},"After changing auth settings, run ",[139,286,287],{},"cloudconfig auth status"," to check required\nsecrets before ",[290,291,292],"a",{"href":40},"deploying",".",[295,296,297],"style",{},"html pre.shiki code .snPdu, html code.shiki .snPdu{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sxrX7, html code.shiki .sxrX7{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sBjJW, html code.shiki .sBjJW{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":149,"searchDepth":167,"depth":167,"links":299},[300,301,302,303],{"id":133,"depth":167,"text":134},{"id":226,"depth":167,"text":227},{"id":248,"depth":167,"text":249},{"id":258,"depth":167,"text":259},"Require an email code or a passkey after primary sign-in.","md",null,{},{"icon":37},{"title":34,"description":304},"RUPXW8XUE2NAlbCFWyMwp4Uv8KNiI0aOLIiyEFQZk20",[312,314],{"title":29,"path":30,"stem":31,"description":313,"icon":32},"Limit private rows to their owner and add application-specific user fields.",{"title":39,"path":40,"stem":41,"description":315,"icon":44},"Put your app online with Cloudflare, Vercel, or Azure.",1792122403758]