[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-better-auth-two-factor-authentication-best-practices":3,"mdc--o6p4ib-key":33,"related-org-better-auth-two-factor-authentication-best-practices":4799,"related-repo-better-auth-two-factor-authentication-best-practices":4877},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":29,"sourceUrl":31,"mdContent":32},"two-factor-authentication-best-practices","set up 2FA flows in Better Auth","Configure TOTP authenticator apps, send OTP codes via email\u002FSMS, manage backup codes, handle trusted devices, and implement 2FA sign-in flows using Better Auth's twoFactor plugin. Use when users need MFA, multi-factor authentication, authenticator setup, or login security with Better Auth.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"better-auth","Better Auth","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fbetter-auth.png",[12,14,17,20],{"name":9,"slug":8,"type":13},"tag",{"name":15,"slug":16,"type":13},"Auth","auth",{"name":18,"slug":19,"type":13},"2FA","two-factor-auth",{"name":21,"slug":22,"type":13},"MFA","mfa",201,"https:\u002F\u002Fgithub.com\u002Fbetter-auth\u002Fskills","2026-04-06T18:04:58.118682",null,28,[],{"repoUrl":24,"stars":23,"forks":27,"topics":30,"description":26},[],"https:\u002F\u002Fgithub.com\u002Fbetter-auth\u002Fskills\u002Ftree\u002FHEAD\u002Fbetter-auth\u002FtwoFactor","---\nname: two-factor-authentication-best-practices\ndescription: Configure TOTP authenticator apps, send OTP codes via email\u002FSMS, manage backup codes, handle trusted devices, and implement 2FA sign-in flows using Better Auth's twoFactor plugin. Use when users need MFA, multi-factor authentication, authenticator setup, or login security with Better Auth.\n---\n\n## Setup\n\n1. Add `twoFactor()` plugin to server config with `issuer`\n2. Add `twoFactorClient()` plugin to client config\n3. Run `npx @better-auth\u002Fcli@latest migrate` (built-in adapter) or generate + push for Drizzle\u002FPrisma\n4. Verify: check that `twoFactorSecret` column exists on user table\n\n```ts\nimport { betterAuth } from \"better-auth\";\nimport { twoFactor } from \"better-auth\u002Fplugins\";\n\nexport const auth = betterAuth({\n  appName: \"My App\",\n  plugins: [\n    twoFactor({\n      issuer: \"My App\",\n    }),\n  ],\n});\n```\n\n### Client-Side Setup\n\n```ts\nimport { createAuthClient } from \"better-auth\u002Fclient\";\nimport { twoFactorClient } from \"better-auth\u002Fclient\u002Fplugins\";\n\nexport const authClient = createAuthClient({\n  plugins: [\n    twoFactorClient({\n      onTwoFactorRedirect() {\n        window.location.href = \"\u002F2fa\";\n      },\n    }),\n  ],\n});\n```\n\n## Enabling 2FA for Users\n\nRequires password verification. Returns TOTP URI (for QR code) and backup codes.\n\n```ts\nconst enable2FA = async (password: string) => {\n  const { data, error } = await authClient.twoFactor.enable({\n    password,\n  });\n\n  if (data) {\n    \u002F\u002F data.totpURI — generate a QR code from this\n    \u002F\u002F data.backupCodes — display to user\n  }\n};\n```\n\n`twoFactorEnabled` is not set to `true` until first TOTP verification succeeds. Override with `skipVerificationOnEnable: true` (not recommended).\n\n## TOTP (Authenticator App)\n\n### Displaying the QR Code\n\n```tsx\nimport QRCode from \"react-qr-code\";\n\nconst TotpSetup = ({ totpURI }: { totpURI: string }) => {\n  return \u003CQRCode value={totpURI} \u002F>;\n};\n```\n\n### Verifying TOTP Codes\n\nAccepts codes from one period before\u002Fafter current time:\n\n```ts\nconst verifyTotp = async (code: string) => {\n  const { data, error } = await authClient.twoFactor.verifyTotp({\n    code,\n    trustDevice: true,\n  });\n};\n```\n\n### TOTP Configuration Options\n\n```ts\ntwoFactor({\n  totpOptions: {\n    digits: 6, \u002F\u002F 6 or 8 digits (default: 6)\n    period: 30, \u002F\u002F Code validity period in seconds (default: 30)\n  },\n});\n```\n\n## OTP (Email\u002FSMS)\n\n### Configuring OTP Delivery\n\n```ts\nimport { betterAuth } from \"better-auth\";\nimport { twoFactor } from \"better-auth\u002Fplugins\";\nimport { sendEmail } from \".\u002Femail\";\n\nexport const auth = betterAuth({\n  plugins: [\n    twoFactor({\n      otpOptions: {\n        sendOTP: async ({ user, otp }, ctx) => {\n          await sendEmail({\n            to: user.email,\n            subject: \"Your verification code\",\n            text: `Your code is: ${otp}`,\n          });\n        },\n        period: 5, \u002F\u002F Code validity in minutes (default: 3)\n        digits: 6, \u002F\u002F Number of digits (default: 6)\n        allowedAttempts: 5, \u002F\u002F Max verification attempts (default: 5)\n      },\n    }),\n  ],\n});\n```\n\n### Sending and Verifying OTP\n\nSend: `authClient.twoFactor.sendOtp()`. Verify: `authClient.twoFactor.verifyOtp({ code, trustDevice: true })`.\n\n### OTP Storage Security\n\nConfigure how OTP codes are stored in the database:\n\n```ts\ntwoFactor({\n  otpOptions: {\n    storeOTP: \"encrypted\", \u002F\u002F Options: \"plain\", \"encrypted\", \"hashed\"\n  },\n});\n```\n\nFor custom encryption:\n\n```ts\ntwoFactor({\n  otpOptions: {\n    storeOTP: {\n      encrypt: async (token) => myEncrypt(token),\n      decrypt: async (token) => myDecrypt(token),\n    },\n  },\n});\n```\n\n## Backup Codes\n\nGenerated automatically when 2FA is enabled. Each code is single-use.\n\n### Displaying Backup Codes\n\n```tsx\nconst BackupCodes = ({ codes }: { codes: string[] }) => {\n  return (\n    \u003Cdiv>\n      \u003Cp>Save these codes in a secure location:\u003C\u002Fp>\n      \u003Cul>\n        {codes.map((code, i) => (\n          \u003Cli key={i}>{code}\u003C\u002Fli>\n        ))}\n      \u003C\u002Ful>\n    \u003C\u002Fdiv>\n  );\n};\n```\n\n### Regenerating Backup Codes\n\nInvalidates all previous codes:\n\n```ts\nconst regenerateBackupCodes = async (password: string) => {\n  const { data, error } = await authClient.twoFactor.generateBackupCodes({\n    password,\n  });\n  \u002F\u002F data.backupCodes contains the new codes\n};\n```\n\n### Using Backup Codes for Recovery\n\n```ts\nconst verifyBackupCode = async (code: string) => {\n  const { data, error } = await authClient.twoFactor.verifyBackupCode({\n    code,\n    trustDevice: true,\n  });\n};\n```\n\n### Backup Code Configuration\n\n```ts\ntwoFactor({\n  backupCodeOptions: {\n    amount: 10, \u002F\u002F Number of codes to generate (default: 10)\n    length: 10, \u002F\u002F Length of each code (default: 10)\n    storeBackupCodes: \"encrypted\", \u002F\u002F Options: \"plain\", \"encrypted\"\n  },\n});\n```\n\n## Handling 2FA During Sign-In\n\nResponse includes `twoFactorRedirect: true` when 2FA is required:\n\n### Sign-In Flow\n\n1. Call `signIn.email({ email, password })`\n2. Check `context.data.twoFactorRedirect` in `onSuccess`\n3. If `true`, redirect to `\u002F2fa` verification page\n4. Verify via TOTP, OTP, or backup code\n5. Session cookie is created on successful verification\n\n```ts\nconst signIn = async (email: string, password: string) => {\n  const { data, error } = await authClient.signIn.email(\n    { email, password },\n    {\n      onSuccess(context) {\n        if (context.data.twoFactorRedirect) {\n          window.location.href = \"\u002F2fa\";\n        }\n      },\n    }\n  );\n};\n```\n\nServer-side: check `\"twoFactorRedirect\" in response` when using `auth.api.signInEmail`.\n\n## Trusted Devices\n\nPass `trustDevice: true` when verifying. Default trust duration: 30 days (`trustDeviceMaxAge`). Refreshes on each sign-in.\n\n## Security Considerations\n\n### Session Management\n\nFlow: credentials → session removed → temporary 2FA cookie (10 min default) → verify → session created.\n\n```ts\ntwoFactor({\n  twoFactorCookieMaxAge: 600, \u002F\u002F 10 minutes in seconds (default)\n});\n```\n\n### Rate Limiting\n\nBuilt-in: 3 requests per 10 seconds for all 2FA endpoints. OTP has additional attempt limiting:\n\n```ts\ntwoFactor({\n  otpOptions: {\n    allowedAttempts: 5, \u002F\u002F Max attempts per OTP code (default: 5)\n  },\n});\n```\n\n### Encryption at Rest\n\nTOTP secrets: encrypted with auth secret. Backup codes: encrypted by default. OTP: configurable (`\"plain\"`, `\"encrypted\"`, `\"hashed\"`). Uses constant-time comparison for verification.\n\n2FA can only be enabled for credential (email\u002Fpassword) accounts.\n\n## Disabling 2FA\n\nRequires password confirmation. Revokes trusted device records:\n\n```ts\nconst disable2FA = async (password: string) => {\n  const { data, error } = await authClient.twoFactor.disable({\n    password,\n  });\n};\n```\n\n## Complete Configuration Example\n\n```ts\nimport { betterAuth } from \"better-auth\";\nimport { twoFactor } from \"better-auth\u002Fplugins\";\nimport { sendEmail } from \".\u002Femail\";\n\nexport const auth = betterAuth({\n  appName: \"My App\",\n  plugins: [\n    twoFactor({\n      \u002F\u002F TOTP settings\n      issuer: \"My App\",\n      totpOptions: {\n        digits: 6,\n        period: 30,\n      },\n      \u002F\u002F OTP settings\n      otpOptions: {\n        sendOTP: async ({ user, otp }) => {\n          await sendEmail({\n            to: user.email,\n            subject: \"Your verification code\",\n            text: `Your code is: ${otp}`,\n          });\n        },\n        period: 5,\n        allowedAttempts: 5,\n        storeOTP: \"encrypted\",\n      },\n      \u002F\u002F Backup code settings\n      backupCodeOptions: {\n        amount: 10,\n        length: 10,\n        storeBackupCodes: \"encrypted\",\n      },\n      \u002F\u002F Session settings\n      twoFactorCookieMaxAge: 600, \u002F\u002F 10 minutes\n      trustDeviceMaxAge: 30 * 24 * 60 * 60, \u002F\u002F 30 days\n    }),\n  ],\n});\n```\n",{"data":34,"body":35},{"name":4,"description":6},{"type":36,"children":37},"root",[38,47,110,412,419,695,701,707,935,962,968,974,1129,1135,1140,1315,1321,1435,1441,1447,1990,1996,2016,2022,2027,2121,2126,2300,2306,2311,2317,2635,2641,2646,2806,2812,2983,2989,3133,3139,3152,3158,3220,3538,3558,3564,3585,3591,3597,3602,3665,3671,3676,3760,3766,3794,3799,3805,3810,3962,3968,4793],{"type":39,"tag":40,"props":41,"children":43},"element","h2",{"id":42},"setup",[44],{"type":45,"value":46},"text","Setup",{"type":39,"tag":48,"props":49,"children":50},"ol",{},[51,72,84,97],{"type":39,"tag":52,"props":53,"children":54},"li",{},[55,57,64,66],{"type":45,"value":56},"Add ",{"type":39,"tag":58,"props":59,"children":61},"code",{"className":60},[],[62],{"type":45,"value":63},"twoFactor()",{"type":45,"value":65}," plugin to server config with ",{"type":39,"tag":58,"props":67,"children":69},{"className":68},[],[70],{"type":45,"value":71},"issuer",{"type":39,"tag":52,"props":73,"children":74},{},[75,76,82],{"type":45,"value":56},{"type":39,"tag":58,"props":77,"children":79},{"className":78},[],[80],{"type":45,"value":81},"twoFactorClient()",{"type":45,"value":83}," plugin to client config",{"type":39,"tag":52,"props":85,"children":86},{},[87,89,95],{"type":45,"value":88},"Run ",{"type":39,"tag":58,"props":90,"children":92},{"className":91},[],[93],{"type":45,"value":94},"npx @better-auth\u002Fcli@latest migrate",{"type":45,"value":96}," (built-in adapter) or generate + push for Drizzle\u002FPrisma",{"type":39,"tag":52,"props":98,"children":99},{},[100,102,108],{"type":45,"value":101},"Verify: check that ",{"type":39,"tag":58,"props":103,"children":105},{"className":104},[],[106],{"type":45,"value":107},"twoFactorSecret",{"type":45,"value":109}," column exists on user table",{"type":39,"tag":111,"props":112,"children":117},"pre",{"className":113,"code":114,"language":115,"meta":116,"style":116},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { betterAuth } from \"better-auth\";\nimport { twoFactor } from \"better-auth\u002Fplugins\";\n\nexport const auth = betterAuth({\n  appName: \"My App\",\n  plugins: [\n    twoFactor({\n      issuer: \"My App\",\n    }),\n  ],\n});\n","ts","",[118],{"type":39,"tag":58,"props":119,"children":120},{"__ignoreMap":116},[121,175,217,227,267,300,318,335,364,382,395],{"type":39,"tag":122,"props":123,"children":126},"span",{"class":124,"line":125},"line",1,[127,133,139,145,150,155,160,165,170],{"type":39,"tag":122,"props":128,"children":130},{"style":129},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[131],{"type":45,"value":132},"import",{"type":39,"tag":122,"props":134,"children":136},{"style":135},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[137],{"type":45,"value":138}," {",{"type":39,"tag":122,"props":140,"children":142},{"style":141},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[143],{"type":45,"value":144}," betterAuth",{"type":39,"tag":122,"props":146,"children":147},{"style":135},[148],{"type":45,"value":149}," }",{"type":39,"tag":122,"props":151,"children":152},{"style":129},[153],{"type":45,"value":154}," from",{"type":39,"tag":122,"props":156,"children":157},{"style":135},[158],{"type":45,"value":159}," \"",{"type":39,"tag":122,"props":161,"children":163},{"style":162},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[164],{"type":45,"value":8},{"type":39,"tag":122,"props":166,"children":167},{"style":135},[168],{"type":45,"value":169},"\"",{"type":39,"tag":122,"props":171,"children":172},{"style":135},[173],{"type":45,"value":174},";\n",{"type":39,"tag":122,"props":176,"children":178},{"class":124,"line":177},2,[179,183,187,192,196,200,204,209,213],{"type":39,"tag":122,"props":180,"children":181},{"style":129},[182],{"type":45,"value":132},{"type":39,"tag":122,"props":184,"children":185},{"style":135},[186],{"type":45,"value":138},{"type":39,"tag":122,"props":188,"children":189},{"style":141},[190],{"type":45,"value":191}," twoFactor",{"type":39,"tag":122,"props":193,"children":194},{"style":135},[195],{"type":45,"value":149},{"type":39,"tag":122,"props":197,"children":198},{"style":129},[199],{"type":45,"value":154},{"type":39,"tag":122,"props":201,"children":202},{"style":135},[203],{"type":45,"value":159},{"type":39,"tag":122,"props":205,"children":206},{"style":162},[207],{"type":45,"value":208},"better-auth\u002Fplugins",{"type":39,"tag":122,"props":210,"children":211},{"style":135},[212],{"type":45,"value":169},{"type":39,"tag":122,"props":214,"children":215},{"style":135},[216],{"type":45,"value":174},{"type":39,"tag":122,"props":218,"children":220},{"class":124,"line":219},3,[221],{"type":39,"tag":122,"props":222,"children":224},{"emptyLinePlaceholder":223},true,[225],{"type":45,"value":226},"\n",{"type":39,"tag":122,"props":228,"children":230},{"class":124,"line":229},4,[231,236,242,247,252,257,262],{"type":39,"tag":122,"props":232,"children":233},{"style":129},[234],{"type":45,"value":235},"export",{"type":39,"tag":122,"props":237,"children":239},{"style":238},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[240],{"type":45,"value":241}," const",{"type":39,"tag":122,"props":243,"children":244},{"style":141},[245],{"type":45,"value":246}," auth ",{"type":39,"tag":122,"props":248,"children":249},{"style":135},[250],{"type":45,"value":251},"=",{"type":39,"tag":122,"props":253,"children":255},{"style":254},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[256],{"type":45,"value":144},{"type":39,"tag":122,"props":258,"children":259},{"style":141},[260],{"type":45,"value":261},"(",{"type":39,"tag":122,"props":263,"children":264},{"style":135},[265],{"type":45,"value":266},"{\n",{"type":39,"tag":122,"props":268,"children":270},{"class":124,"line":269},5,[271,277,282,286,291,295],{"type":39,"tag":122,"props":272,"children":274},{"style":273},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[275],{"type":45,"value":276},"  appName",{"type":39,"tag":122,"props":278,"children":279},{"style":135},[280],{"type":45,"value":281},":",{"type":39,"tag":122,"props":283,"children":284},{"style":135},[285],{"type":45,"value":159},{"type":39,"tag":122,"props":287,"children":288},{"style":162},[289],{"type":45,"value":290},"My App",{"type":39,"tag":122,"props":292,"children":293},{"style":135},[294],{"type":45,"value":169},{"type":39,"tag":122,"props":296,"children":297},{"style":135},[298],{"type":45,"value":299},",\n",{"type":39,"tag":122,"props":301,"children":303},{"class":124,"line":302},6,[304,309,313],{"type":39,"tag":122,"props":305,"children":306},{"style":273},[307],{"type":45,"value":308},"  plugins",{"type":39,"tag":122,"props":310,"children":311},{"style":135},[312],{"type":45,"value":281},{"type":39,"tag":122,"props":314,"children":315},{"style":141},[316],{"type":45,"value":317}," [\n",{"type":39,"tag":122,"props":319,"children":321},{"class":124,"line":320},7,[322,327,331],{"type":39,"tag":122,"props":323,"children":324},{"style":254},[325],{"type":45,"value":326},"    twoFactor",{"type":39,"tag":122,"props":328,"children":329},{"style":141},[330],{"type":45,"value":261},{"type":39,"tag":122,"props":332,"children":333},{"style":135},[334],{"type":45,"value":266},{"type":39,"tag":122,"props":336,"children":338},{"class":124,"line":337},8,[339,344,348,352,356,360],{"type":39,"tag":122,"props":340,"children":341},{"style":273},[342],{"type":45,"value":343},"      issuer",{"type":39,"tag":122,"props":345,"children":346},{"style":135},[347],{"type":45,"value":281},{"type":39,"tag":122,"props":349,"children":350},{"style":135},[351],{"type":45,"value":159},{"type":39,"tag":122,"props":353,"children":354},{"style":162},[355],{"type":45,"value":290},{"type":39,"tag":122,"props":357,"children":358},{"style":135},[359],{"type":45,"value":169},{"type":39,"tag":122,"props":361,"children":362},{"style":135},[363],{"type":45,"value":299},{"type":39,"tag":122,"props":365,"children":367},{"class":124,"line":366},9,[368,373,378],{"type":39,"tag":122,"props":369,"children":370},{"style":135},[371],{"type":45,"value":372},"    }",{"type":39,"tag":122,"props":374,"children":375},{"style":141},[376],{"type":45,"value":377},")",{"type":39,"tag":122,"props":379,"children":380},{"style":135},[381],{"type":45,"value":299},{"type":39,"tag":122,"props":383,"children":385},{"class":124,"line":384},10,[386,391],{"type":39,"tag":122,"props":387,"children":388},{"style":141},[389],{"type":45,"value":390},"  ]",{"type":39,"tag":122,"props":392,"children":393},{"style":135},[394],{"type":45,"value":299},{"type":39,"tag":122,"props":396,"children":398},{"class":124,"line":397},11,[399,404,408],{"type":39,"tag":122,"props":400,"children":401},{"style":135},[402],{"type":45,"value":403},"}",{"type":39,"tag":122,"props":405,"children":406},{"style":141},[407],{"type":45,"value":377},{"type":39,"tag":122,"props":409,"children":410},{"style":135},[411],{"type":45,"value":174},{"type":39,"tag":413,"props":414,"children":416},"h3",{"id":415},"client-side-setup",[417],{"type":45,"value":418},"Client-Side Setup",{"type":39,"tag":111,"props":420,"children":422},{"className":113,"code":421,"language":115,"meta":116,"style":116},"import { createAuthClient } from \"better-auth\u002Fclient\";\nimport { twoFactorClient } from \"better-auth\u002Fclient\u002Fplugins\";\n\nexport const authClient = createAuthClient({\n  plugins: [\n    twoFactorClient({\n      onTwoFactorRedirect() {\n        window.location.href = \"\u002F2fa\";\n      },\n    }),\n  ],\n});\n",[423],{"type":39,"tag":58,"props":424,"children":425},{"__ignoreMap":116},[426,467,508,515,547,562,578,596,645,653,668,679],{"type":39,"tag":122,"props":427,"children":428},{"class":124,"line":125},[429,433,437,442,446,450,454,459,463],{"type":39,"tag":122,"props":430,"children":431},{"style":129},[432],{"type":45,"value":132},{"type":39,"tag":122,"props":434,"children":435},{"style":135},[436],{"type":45,"value":138},{"type":39,"tag":122,"props":438,"children":439},{"style":141},[440],{"type":45,"value":441}," createAuthClient",{"type":39,"tag":122,"props":443,"children":444},{"style":135},[445],{"type":45,"value":149},{"type":39,"tag":122,"props":447,"children":448},{"style":129},[449],{"type":45,"value":154},{"type":39,"tag":122,"props":451,"children":452},{"style":135},[453],{"type":45,"value":159},{"type":39,"tag":122,"props":455,"children":456},{"style":162},[457],{"type":45,"value":458},"better-auth\u002Fclient",{"type":39,"tag":122,"props":460,"children":461},{"style":135},[462],{"type":45,"value":169},{"type":39,"tag":122,"props":464,"children":465},{"style":135},[466],{"type":45,"value":174},{"type":39,"tag":122,"props":468,"children":469},{"class":124,"line":177},[470,474,478,483,487,491,495,500,504],{"type":39,"tag":122,"props":471,"children":472},{"style":129},[473],{"type":45,"value":132},{"type":39,"tag":122,"props":475,"children":476},{"style":135},[477],{"type":45,"value":138},{"type":39,"tag":122,"props":479,"children":480},{"style":141},[481],{"type":45,"value":482}," twoFactorClient",{"type":39,"tag":122,"props":484,"children":485},{"style":135},[486],{"type":45,"value":149},{"type":39,"tag":122,"props":488,"children":489},{"style":129},[490],{"type":45,"value":154},{"type":39,"tag":122,"props":492,"children":493},{"style":135},[494],{"type":45,"value":159},{"type":39,"tag":122,"props":496,"children":497},{"style":162},[498],{"type":45,"value":499},"better-auth\u002Fclient\u002Fplugins",{"type":39,"tag":122,"props":501,"children":502},{"style":135},[503],{"type":45,"value":169},{"type":39,"tag":122,"props":505,"children":506},{"style":135},[507],{"type":45,"value":174},{"type":39,"tag":122,"props":509,"children":510},{"class":124,"line":219},[511],{"type":39,"tag":122,"props":512,"children":513},{"emptyLinePlaceholder":223},[514],{"type":45,"value":226},{"type":39,"tag":122,"props":516,"children":517},{"class":124,"line":229},[518,522,526,531,535,539,543],{"type":39,"tag":122,"props":519,"children":520},{"style":129},[521],{"type":45,"value":235},{"type":39,"tag":122,"props":523,"children":524},{"style":238},[525],{"type":45,"value":241},{"type":39,"tag":122,"props":527,"children":528},{"style":141},[529],{"type":45,"value":530}," authClient ",{"type":39,"tag":122,"props":532,"children":533},{"style":135},[534],{"type":45,"value":251},{"type":39,"tag":122,"props":536,"children":537},{"style":254},[538],{"type":45,"value":441},{"type":39,"tag":122,"props":540,"children":541},{"style":141},[542],{"type":45,"value":261},{"type":39,"tag":122,"props":544,"children":545},{"style":135},[546],{"type":45,"value":266},{"type":39,"tag":122,"props":548,"children":549},{"class":124,"line":269},[550,554,558],{"type":39,"tag":122,"props":551,"children":552},{"style":273},[553],{"type":45,"value":308},{"type":39,"tag":122,"props":555,"children":556},{"style":135},[557],{"type":45,"value":281},{"type":39,"tag":122,"props":559,"children":560},{"style":141},[561],{"type":45,"value":317},{"type":39,"tag":122,"props":563,"children":564},{"class":124,"line":302},[565,570,574],{"type":39,"tag":122,"props":566,"children":567},{"style":254},[568],{"type":45,"value":569},"    twoFactorClient",{"type":39,"tag":122,"props":571,"children":572},{"style":141},[573],{"type":45,"value":261},{"type":39,"tag":122,"props":575,"children":576},{"style":135},[577],{"type":45,"value":266},{"type":39,"tag":122,"props":579,"children":580},{"class":124,"line":320},[581,586,591],{"type":39,"tag":122,"props":582,"children":583},{"style":273},[584],{"type":45,"value":585},"      onTwoFactorRedirect",{"type":39,"tag":122,"props":587,"children":588},{"style":135},[589],{"type":45,"value":590},"()",{"type":39,"tag":122,"props":592,"children":593},{"style":135},[594],{"type":45,"value":595}," {\n",{"type":39,"tag":122,"props":597,"children":598},{"class":124,"line":337},[599,604,609,614,618,623,628,632,637,641],{"type":39,"tag":122,"props":600,"children":601},{"style":141},[602],{"type":45,"value":603},"        window",{"type":39,"tag":122,"props":605,"children":606},{"style":135},[607],{"type":45,"value":608},".",{"type":39,"tag":122,"props":610,"children":611},{"style":141},[612],{"type":45,"value":613},"location",{"type":39,"tag":122,"props":615,"children":616},{"style":135},[617],{"type":45,"value":608},{"type":39,"tag":122,"props":619,"children":620},{"style":141},[621],{"type":45,"value":622},"href",{"type":39,"tag":122,"props":624,"children":625},{"style":135},[626],{"type":45,"value":627}," =",{"type":39,"tag":122,"props":629,"children":630},{"style":135},[631],{"type":45,"value":159},{"type":39,"tag":122,"props":633,"children":634},{"style":162},[635],{"type":45,"value":636},"\u002F2fa",{"type":39,"tag":122,"props":638,"children":639},{"style":135},[640],{"type":45,"value":169},{"type":39,"tag":122,"props":642,"children":643},{"style":135},[644],{"type":45,"value":174},{"type":39,"tag":122,"props":646,"children":647},{"class":124,"line":366},[648],{"type":39,"tag":122,"props":649,"children":650},{"style":135},[651],{"type":45,"value":652},"      },\n",{"type":39,"tag":122,"props":654,"children":655},{"class":124,"line":384},[656,660,664],{"type":39,"tag":122,"props":657,"children":658},{"style":135},[659],{"type":45,"value":372},{"type":39,"tag":122,"props":661,"children":662},{"style":141},[663],{"type":45,"value":377},{"type":39,"tag":122,"props":665,"children":666},{"style":135},[667],{"type":45,"value":299},{"type":39,"tag":122,"props":669,"children":670},{"class":124,"line":397},[671,675],{"type":39,"tag":122,"props":672,"children":673},{"style":141},[674],{"type":45,"value":390},{"type":39,"tag":122,"props":676,"children":677},{"style":135},[678],{"type":45,"value":299},{"type":39,"tag":122,"props":680,"children":682},{"class":124,"line":681},12,[683,687,691],{"type":39,"tag":122,"props":684,"children":685},{"style":135},[686],{"type":45,"value":403},{"type":39,"tag":122,"props":688,"children":689},{"style":141},[690],{"type":45,"value":377},{"type":39,"tag":122,"props":692,"children":693},{"style":135},[694],{"type":45,"value":174},{"type":39,"tag":40,"props":696,"children":698},{"id":697},"enabling-2fa-for-users",[699],{"type":45,"value":700},"Enabling 2FA for Users",{"type":39,"tag":702,"props":703,"children":704},"p",{},[705],{"type":45,"value":706},"Requires password verification. Returns TOTP URI (for QR code) and backup codes.",{"type":39,"tag":111,"props":708,"children":710},{"className":113,"code":709,"language":115,"meta":116,"style":116},"const enable2FA = async (password: string) => {\n  const { data, error } = await authClient.twoFactor.enable({\n    password,\n  });\n\n  if (data) {\n    \u002F\u002F data.totpURI — generate a QR code from this\n    \u002F\u002F data.backupCodes — display to user\n  }\n};\n",[711],{"type":39,"tag":58,"props":712,"children":713},{"__ignoreMap":116},[714,770,841,853,869,876,902,911,919,927],{"type":39,"tag":122,"props":715,"children":716},{"class":124,"line":125},[717,722,727,731,736,741,747,751,757,761,766],{"type":39,"tag":122,"props":718,"children":719},{"style":238},[720],{"type":45,"value":721},"const",{"type":39,"tag":122,"props":723,"children":724},{"style":141},[725],{"type":45,"value":726}," enable2FA ",{"type":39,"tag":122,"props":728,"children":729},{"style":135},[730],{"type":45,"value":251},{"type":39,"tag":122,"props":732,"children":733},{"style":238},[734],{"type":45,"value":735}," async",{"type":39,"tag":122,"props":737,"children":738},{"style":135},[739],{"type":45,"value":740}," (",{"type":39,"tag":122,"props":742,"children":744},{"style":743},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[745],{"type":45,"value":746},"password",{"type":39,"tag":122,"props":748,"children":749},{"style":135},[750],{"type":45,"value":281},{"type":39,"tag":122,"props":752,"children":754},{"style":753},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[755],{"type":45,"value":756}," string",{"type":39,"tag":122,"props":758,"children":759},{"style":135},[760],{"type":45,"value":377},{"type":39,"tag":122,"props":762,"children":763},{"style":238},[764],{"type":45,"value":765}," =>",{"type":39,"tag":122,"props":767,"children":768},{"style":135},[769],{"type":45,"value":595},{"type":39,"tag":122,"props":771,"children":772},{"class":124,"line":177},[773,778,782,787,792,797,801,805,810,815,819,824,828,833,837],{"type":39,"tag":122,"props":774,"children":775},{"style":238},[776],{"type":45,"value":777},"  const",{"type":39,"tag":122,"props":779,"children":780},{"style":135},[781],{"type":45,"value":138},{"type":39,"tag":122,"props":783,"children":784},{"style":141},[785],{"type":45,"value":786}," data",{"type":39,"tag":122,"props":788,"children":789},{"style":135},[790],{"type":45,"value":791},",",{"type":39,"tag":122,"props":793,"children":794},{"style":141},[795],{"type":45,"value":796}," error",{"type":39,"tag":122,"props":798,"children":799},{"style":135},[800],{"type":45,"value":149},{"type":39,"tag":122,"props":802,"children":803},{"style":135},[804],{"type":45,"value":627},{"type":39,"tag":122,"props":806,"children":807},{"style":129},[808],{"type":45,"value":809}," await",{"type":39,"tag":122,"props":811,"children":812},{"style":141},[813],{"type":45,"value":814}," authClient",{"type":39,"tag":122,"props":816,"children":817},{"style":135},[818],{"type":45,"value":608},{"type":39,"tag":122,"props":820,"children":821},{"style":141},[822],{"type":45,"value":823},"twoFactor",{"type":39,"tag":122,"props":825,"children":826},{"style":135},[827],{"type":45,"value":608},{"type":39,"tag":122,"props":829,"children":830},{"style":254},[831],{"type":45,"value":832},"enable",{"type":39,"tag":122,"props":834,"children":835},{"style":273},[836],{"type":45,"value":261},{"type":39,"tag":122,"props":838,"children":839},{"style":135},[840],{"type":45,"value":266},{"type":39,"tag":122,"props":842,"children":843},{"class":124,"line":219},[844,849],{"type":39,"tag":122,"props":845,"children":846},{"style":141},[847],{"type":45,"value":848},"    password",{"type":39,"tag":122,"props":850,"children":851},{"style":135},[852],{"type":45,"value":299},{"type":39,"tag":122,"props":854,"children":855},{"class":124,"line":229},[856,861,865],{"type":39,"tag":122,"props":857,"children":858},{"style":135},[859],{"type":45,"value":860},"  }",{"type":39,"tag":122,"props":862,"children":863},{"style":273},[864],{"type":45,"value":377},{"type":39,"tag":122,"props":866,"children":867},{"style":135},[868],{"type":45,"value":174},{"type":39,"tag":122,"props":870,"children":871},{"class":124,"line":269},[872],{"type":39,"tag":122,"props":873,"children":874},{"emptyLinePlaceholder":223},[875],{"type":45,"value":226},{"type":39,"tag":122,"props":877,"children":878},{"class":124,"line":302},[879,884,888,893,898],{"type":39,"tag":122,"props":880,"children":881},{"style":129},[882],{"type":45,"value":883},"  if",{"type":39,"tag":122,"props":885,"children":886},{"style":273},[887],{"type":45,"value":740},{"type":39,"tag":122,"props":889,"children":890},{"style":141},[891],{"type":45,"value":892},"data",{"type":39,"tag":122,"props":894,"children":895},{"style":273},[896],{"type":45,"value":897},") ",{"type":39,"tag":122,"props":899,"children":900},{"style":135},[901],{"type":45,"value":266},{"type":39,"tag":122,"props":903,"children":904},{"class":124,"line":320},[905],{"type":39,"tag":122,"props":906,"children":908},{"style":907},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[909],{"type":45,"value":910},"    \u002F\u002F data.totpURI — generate a QR code from this\n",{"type":39,"tag":122,"props":912,"children":913},{"class":124,"line":337},[914],{"type":39,"tag":122,"props":915,"children":916},{"style":907},[917],{"type":45,"value":918},"    \u002F\u002F data.backupCodes — display to user\n",{"type":39,"tag":122,"props":920,"children":921},{"class":124,"line":366},[922],{"type":39,"tag":122,"props":923,"children":924},{"style":135},[925],{"type":45,"value":926},"  }\n",{"type":39,"tag":122,"props":928,"children":929},{"class":124,"line":384},[930],{"type":39,"tag":122,"props":931,"children":932},{"style":135},[933],{"type":45,"value":934},"};\n",{"type":39,"tag":702,"props":936,"children":937},{},[938,944,946,952,954,960],{"type":39,"tag":58,"props":939,"children":941},{"className":940},[],[942],{"type":45,"value":943},"twoFactorEnabled",{"type":45,"value":945}," is not set to ",{"type":39,"tag":58,"props":947,"children":949},{"className":948},[],[950],{"type":45,"value":951},"true",{"type":45,"value":953}," until first TOTP verification succeeds. Override with ",{"type":39,"tag":58,"props":955,"children":957},{"className":956},[],[958],{"type":45,"value":959},"skipVerificationOnEnable: true",{"type":45,"value":961}," (not recommended).",{"type":39,"tag":40,"props":963,"children":965},{"id":964},"totp-authenticator-app",[966],{"type":45,"value":967},"TOTP (Authenticator App)",{"type":39,"tag":413,"props":969,"children":971},{"id":970},"displaying-the-qr-code",[972],{"type":45,"value":973},"Displaying the QR Code",{"type":39,"tag":111,"props":975,"children":979},{"className":976,"code":977,"language":978,"meta":116,"style":116},"language-tsx shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import QRCode from \"react-qr-code\";\n\nconst TotpSetup = ({ totpURI }: { totpURI: string }) => {\n  return \u003CQRCode value={totpURI} \u002F>;\n};\n","tsx",[980],{"type":39,"tag":58,"props":981,"children":982},{"__ignoreMap":116},[983,1017,1024,1084,1122],{"type":39,"tag":122,"props":984,"children":985},{"class":124,"line":125},[986,990,995,1000,1004,1009,1013],{"type":39,"tag":122,"props":987,"children":988},{"style":129},[989],{"type":45,"value":132},{"type":39,"tag":122,"props":991,"children":992},{"style":141},[993],{"type":45,"value":994}," QRCode ",{"type":39,"tag":122,"props":996,"children":997},{"style":129},[998],{"type":45,"value":999},"from",{"type":39,"tag":122,"props":1001,"children":1002},{"style":135},[1003],{"type":45,"value":159},{"type":39,"tag":122,"props":1005,"children":1006},{"style":162},[1007],{"type":45,"value":1008},"react-qr-code",{"type":39,"tag":122,"props":1010,"children":1011},{"style":135},[1012],{"type":45,"value":169},{"type":39,"tag":122,"props":1014,"children":1015},{"style":135},[1016],{"type":45,"value":174},{"type":39,"tag":122,"props":1018,"children":1019},{"class":124,"line":177},[1020],{"type":39,"tag":122,"props":1021,"children":1022},{"emptyLinePlaceholder":223},[1023],{"type":45,"value":226},{"type":39,"tag":122,"props":1025,"children":1026},{"class":124,"line":219},[1027,1031,1036,1040,1045,1050,1055,1059,1063,1067,1071,1076,1080],{"type":39,"tag":122,"props":1028,"children":1029},{"style":238},[1030],{"type":45,"value":721},{"type":39,"tag":122,"props":1032,"children":1033},{"style":141},[1034],{"type":45,"value":1035}," TotpSetup ",{"type":39,"tag":122,"props":1037,"children":1038},{"style":135},[1039],{"type":45,"value":251},{"type":39,"tag":122,"props":1041,"children":1042},{"style":135},[1043],{"type":45,"value":1044}," ({",{"type":39,"tag":122,"props":1046,"children":1047},{"style":743},[1048],{"type":45,"value":1049}," totpURI",{"type":39,"tag":122,"props":1051,"children":1052},{"style":135},[1053],{"type":45,"value":1054}," }:",{"type":39,"tag":122,"props":1056,"children":1057},{"style":135},[1058],{"type":45,"value":138},{"type":39,"tag":122,"props":1060,"children":1061},{"style":273},[1062],{"type":45,"value":1049},{"type":39,"tag":122,"props":1064,"children":1065},{"style":135},[1066],{"type":45,"value":281},{"type":39,"tag":122,"props":1068,"children":1069},{"style":753},[1070],{"type":45,"value":756},{"type":39,"tag":122,"props":1072,"children":1073},{"style":135},[1074],{"type":45,"value":1075}," })",{"type":39,"tag":122,"props":1077,"children":1078},{"style":238},[1079],{"type":45,"value":765},{"type":39,"tag":122,"props":1081,"children":1082},{"style":135},[1083],{"type":45,"value":595},{"type":39,"tag":122,"props":1085,"children":1086},{"class":124,"line":229},[1087,1092,1097,1102,1107,1112,1117],{"type":39,"tag":122,"props":1088,"children":1089},{"style":129},[1090],{"type":45,"value":1091},"  return",{"type":39,"tag":122,"props":1093,"children":1094},{"style":135},[1095],{"type":45,"value":1096}," \u003C",{"type":39,"tag":122,"props":1098,"children":1099},{"style":753},[1100],{"type":45,"value":1101},"QRCode",{"type":39,"tag":122,"props":1103,"children":1104},{"style":238},[1105],{"type":45,"value":1106}," value",{"type":39,"tag":122,"props":1108,"children":1109},{"style":135},[1110],{"type":45,"value":1111},"={",{"type":39,"tag":122,"props":1113,"children":1114},{"style":141},[1115],{"type":45,"value":1116},"totpURI",{"type":39,"tag":122,"props":1118,"children":1119},{"style":135},[1120],{"type":45,"value":1121},"} \u002F>;\n",{"type":39,"tag":122,"props":1123,"children":1124},{"class":124,"line":269},[1125],{"type":39,"tag":122,"props":1126,"children":1127},{"style":135},[1128],{"type":45,"value":934},{"type":39,"tag":413,"props":1130,"children":1132},{"id":1131},"verifying-totp-codes",[1133],{"type":45,"value":1134},"Verifying TOTP Codes",{"type":39,"tag":702,"props":1136,"children":1137},{},[1138],{"type":45,"value":1139},"Accepts codes from one period before\u002Fafter current time:",{"type":39,"tag":111,"props":1141,"children":1143},{"className":113,"code":1142,"language":115,"meta":116,"style":116},"const verifyTotp = async (code: string) => {\n  const { data, error } = await authClient.twoFactor.verifyTotp({\n    code,\n    trustDevice: true,\n  });\n};\n",[1144],{"type":39,"tag":58,"props":1145,"children":1146},{"__ignoreMap":116},[1147,1195,1259,1271,1293,1308],{"type":39,"tag":122,"props":1148,"children":1149},{"class":124,"line":125},[1150,1154,1159,1163,1167,1171,1175,1179,1183,1187,1191],{"type":39,"tag":122,"props":1151,"children":1152},{"style":238},[1153],{"type":45,"value":721},{"type":39,"tag":122,"props":1155,"children":1156},{"style":141},[1157],{"type":45,"value":1158}," verifyTotp ",{"type":39,"tag":122,"props":1160,"children":1161},{"style":135},[1162],{"type":45,"value":251},{"type":39,"tag":122,"props":1164,"children":1165},{"style":238},[1166],{"type":45,"value":735},{"type":39,"tag":122,"props":1168,"children":1169},{"style":135},[1170],{"type":45,"value":740},{"type":39,"tag":122,"props":1172,"children":1173},{"style":743},[1174],{"type":45,"value":58},{"type":39,"tag":122,"props":1176,"children":1177},{"style":135},[1178],{"type":45,"value":281},{"type":39,"tag":122,"props":1180,"children":1181},{"style":753},[1182],{"type":45,"value":756},{"type":39,"tag":122,"props":1184,"children":1185},{"style":135},[1186],{"type":45,"value":377},{"type":39,"tag":122,"props":1188,"children":1189},{"style":238},[1190],{"type":45,"value":765},{"type":39,"tag":122,"props":1192,"children":1193},{"style":135},[1194],{"type":45,"value":595},{"type":39,"tag":122,"props":1196,"children":1197},{"class":124,"line":177},[1198,1202,1206,1210,1214,1218,1222,1226,1230,1234,1238,1242,1246,1251,1255],{"type":39,"tag":122,"props":1199,"children":1200},{"style":238},[1201],{"type":45,"value":777},{"type":39,"tag":122,"props":1203,"children":1204},{"style":135},[1205],{"type":45,"value":138},{"type":39,"tag":122,"props":1207,"children":1208},{"style":141},[1209],{"type":45,"value":786},{"type":39,"tag":122,"props":1211,"children":1212},{"style":135},[1213],{"type":45,"value":791},{"type":39,"tag":122,"props":1215,"children":1216},{"style":141},[1217],{"type":45,"value":796},{"type":39,"tag":122,"props":1219,"children":1220},{"style":135},[1221],{"type":45,"value":149},{"type":39,"tag":122,"props":1223,"children":1224},{"style":135},[1225],{"type":45,"value":627},{"type":39,"tag":122,"props":1227,"children":1228},{"style":129},[1229],{"type":45,"value":809},{"type":39,"tag":122,"props":1231,"children":1232},{"style":141},[1233],{"type":45,"value":814},{"type":39,"tag":122,"props":1235,"children":1236},{"style":135},[1237],{"type":45,"value":608},{"type":39,"tag":122,"props":1239,"children":1240},{"style":141},[1241],{"type":45,"value":823},{"type":39,"tag":122,"props":1243,"children":1244},{"style":135},[1245],{"type":45,"value":608},{"type":39,"tag":122,"props":1247,"children":1248},{"style":254},[1249],{"type":45,"value":1250},"verifyTotp",{"type":39,"tag":122,"props":1252,"children":1253},{"style":273},[1254],{"type":45,"value":261},{"type":39,"tag":122,"props":1256,"children":1257},{"style":135},[1258],{"type":45,"value":266},{"type":39,"tag":122,"props":1260,"children":1261},{"class":124,"line":219},[1262,1267],{"type":39,"tag":122,"props":1263,"children":1264},{"style":141},[1265],{"type":45,"value":1266},"    code",{"type":39,"tag":122,"props":1268,"children":1269},{"style":135},[1270],{"type":45,"value":299},{"type":39,"tag":122,"props":1272,"children":1273},{"class":124,"line":229},[1274,1279,1283,1289],{"type":39,"tag":122,"props":1275,"children":1276},{"style":273},[1277],{"type":45,"value":1278},"    trustDevice",{"type":39,"tag":122,"props":1280,"children":1281},{"style":135},[1282],{"type":45,"value":281},{"type":39,"tag":122,"props":1284,"children":1286},{"style":1285},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[1287],{"type":45,"value":1288}," true",{"type":39,"tag":122,"props":1290,"children":1291},{"style":135},[1292],{"type":45,"value":299},{"type":39,"tag":122,"props":1294,"children":1295},{"class":124,"line":269},[1296,1300,1304],{"type":39,"tag":122,"props":1297,"children":1298},{"style":135},[1299],{"type":45,"value":860},{"type":39,"tag":122,"props":1301,"children":1302},{"style":273},[1303],{"type":45,"value":377},{"type":39,"tag":122,"props":1305,"children":1306},{"style":135},[1307],{"type":45,"value":174},{"type":39,"tag":122,"props":1309,"children":1310},{"class":124,"line":302},[1311],{"type":39,"tag":122,"props":1312,"children":1313},{"style":135},[1314],{"type":45,"value":934},{"type":39,"tag":413,"props":1316,"children":1318},{"id":1317},"totp-configuration-options",[1319],{"type":45,"value":1320},"TOTP Configuration Options",{"type":39,"tag":111,"props":1322,"children":1324},{"className":113,"code":1323,"language":115,"meta":116,"style":116},"twoFactor({\n  totpOptions: {\n    digits: 6, \u002F\u002F 6 or 8 digits (default: 6)\n    period: 30, \u002F\u002F Code validity period in seconds (default: 30)\n  },\n});\n",[1325],{"type":39,"tag":58,"props":1326,"children":1327},{"__ignoreMap":116},[1328,1343,1359,1386,1412,1420],{"type":39,"tag":122,"props":1329,"children":1330},{"class":124,"line":125},[1331,1335,1339],{"type":39,"tag":122,"props":1332,"children":1333},{"style":254},[1334],{"type":45,"value":823},{"type":39,"tag":122,"props":1336,"children":1337},{"style":141},[1338],{"type":45,"value":261},{"type":39,"tag":122,"props":1340,"children":1341},{"style":135},[1342],{"type":45,"value":266},{"type":39,"tag":122,"props":1344,"children":1345},{"class":124,"line":177},[1346,1351,1355],{"type":39,"tag":122,"props":1347,"children":1348},{"style":273},[1349],{"type":45,"value":1350},"  totpOptions",{"type":39,"tag":122,"props":1352,"children":1353},{"style":135},[1354],{"type":45,"value":281},{"type":39,"tag":122,"props":1356,"children":1357},{"style":135},[1358],{"type":45,"value":595},{"type":39,"tag":122,"props":1360,"children":1361},{"class":124,"line":219},[1362,1367,1371,1377,1381],{"type":39,"tag":122,"props":1363,"children":1364},{"style":273},[1365],{"type":45,"value":1366},"    digits",{"type":39,"tag":122,"props":1368,"children":1369},{"style":135},[1370],{"type":45,"value":281},{"type":39,"tag":122,"props":1372,"children":1374},{"style":1373},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1375],{"type":45,"value":1376}," 6",{"type":39,"tag":122,"props":1378,"children":1379},{"style":135},[1380],{"type":45,"value":791},{"type":39,"tag":122,"props":1382,"children":1383},{"style":907},[1384],{"type":45,"value":1385}," \u002F\u002F 6 or 8 digits (default: 6)\n",{"type":39,"tag":122,"props":1387,"children":1388},{"class":124,"line":229},[1389,1394,1398,1403,1407],{"type":39,"tag":122,"props":1390,"children":1391},{"style":273},[1392],{"type":45,"value":1393},"    period",{"type":39,"tag":122,"props":1395,"children":1396},{"style":135},[1397],{"type":45,"value":281},{"type":39,"tag":122,"props":1399,"children":1400},{"style":1373},[1401],{"type":45,"value":1402}," 30",{"type":39,"tag":122,"props":1404,"children":1405},{"style":135},[1406],{"type":45,"value":791},{"type":39,"tag":122,"props":1408,"children":1409},{"style":907},[1410],{"type":45,"value":1411}," \u002F\u002F Code validity period in seconds (default: 30)\n",{"type":39,"tag":122,"props":1413,"children":1414},{"class":124,"line":269},[1415],{"type":39,"tag":122,"props":1416,"children":1417},{"style":135},[1418],{"type":45,"value":1419},"  },\n",{"type":39,"tag":122,"props":1421,"children":1422},{"class":124,"line":302},[1423,1427,1431],{"type":39,"tag":122,"props":1424,"children":1425},{"style":135},[1426],{"type":45,"value":403},{"type":39,"tag":122,"props":1428,"children":1429},{"style":141},[1430],{"type":45,"value":377},{"type":39,"tag":122,"props":1432,"children":1433},{"style":135},[1434],{"type":45,"value":174},{"type":39,"tag":40,"props":1436,"children":1438},{"id":1437},"otp-emailsms",[1439],{"type":45,"value":1440},"OTP (Email\u002FSMS)",{"type":39,"tag":413,"props":1442,"children":1444},{"id":1443},"configuring-otp-delivery",[1445],{"type":45,"value":1446},"Configuring OTP Delivery",{"type":39,"tag":111,"props":1448,"children":1450},{"className":113,"code":1449,"language":115,"meta":116,"style":116},"import { betterAuth } from \"better-auth\";\nimport { twoFactor } from \"better-auth\u002Fplugins\";\nimport { sendEmail } from \".\u002Femail\";\n\nexport const auth = betterAuth({\n  plugins: [\n    twoFactor({\n      otpOptions: {\n        sendOTP: async ({ user, otp }, ctx) => {\n          await sendEmail({\n            to: user.email,\n            subject: \"Your verification code\",\n            text: `Your code is: ${otp}`,\n          });\n        },\n        period: 5, \u002F\u002F Code validity in minutes (default: 3)\n        digits: 6, \u002F\u002F Number of digits (default: 6)\n        allowedAttempts: 5, \u002F\u002F Max verification attempts (default: 5)\n      },\n    }),\n  ],\n});\n",[1451],{"type":39,"tag":58,"props":1452,"children":1453},{"__ignoreMap":116},[1454,1493,1532,1573,1580,1611,1626,1641,1657,1713,1733,1762,1791,1833,1850,1859,1886,1912,1938,1946,1962,1974],{"type":39,"tag":122,"props":1455,"children":1456},{"class":124,"line":125},[1457,1461,1465,1469,1473,1477,1481,1485,1489],{"type":39,"tag":122,"props":1458,"children":1459},{"style":129},[1460],{"type":45,"value":132},{"type":39,"tag":122,"props":1462,"children":1463},{"style":135},[1464],{"type":45,"value":138},{"type":39,"tag":122,"props":1466,"children":1467},{"style":141},[1468],{"type":45,"value":144},{"type":39,"tag":122,"props":1470,"children":1471},{"style":135},[1472],{"type":45,"value":149},{"type":39,"tag":122,"props":1474,"children":1475},{"style":129},[1476],{"type":45,"value":154},{"type":39,"tag":122,"props":1478,"children":1479},{"style":135},[1480],{"type":45,"value":159},{"type":39,"tag":122,"props":1482,"children":1483},{"style":162},[1484],{"type":45,"value":8},{"type":39,"tag":122,"props":1486,"children":1487},{"style":135},[1488],{"type":45,"value":169},{"type":39,"tag":122,"props":1490,"children":1491},{"style":135},[1492],{"type":45,"value":174},{"type":39,"tag":122,"props":1494,"children":1495},{"class":124,"line":177},[1496,1500,1504,1508,1512,1516,1520,1524,1528],{"type":39,"tag":122,"props":1497,"children":1498},{"style":129},[1499],{"type":45,"value":132},{"type":39,"tag":122,"props":1501,"children":1502},{"style":135},[1503],{"type":45,"value":138},{"type":39,"tag":122,"props":1505,"children":1506},{"style":141},[1507],{"type":45,"value":191},{"type":39,"tag":122,"props":1509,"children":1510},{"style":135},[1511],{"type":45,"value":149},{"type":39,"tag":122,"props":1513,"children":1514},{"style":129},[1515],{"type":45,"value":154},{"type":39,"tag":122,"props":1517,"children":1518},{"style":135},[1519],{"type":45,"value":159},{"type":39,"tag":122,"props":1521,"children":1522},{"style":162},[1523],{"type":45,"value":208},{"type":39,"tag":122,"props":1525,"children":1526},{"style":135},[1527],{"type":45,"value":169},{"type":39,"tag":122,"props":1529,"children":1530},{"style":135},[1531],{"type":45,"value":174},{"type":39,"tag":122,"props":1533,"children":1534},{"class":124,"line":219},[1535,1539,1543,1548,1552,1556,1560,1565,1569],{"type":39,"tag":122,"props":1536,"children":1537},{"style":129},[1538],{"type":45,"value":132},{"type":39,"tag":122,"props":1540,"children":1541},{"style":135},[1542],{"type":45,"value":138},{"type":39,"tag":122,"props":1544,"children":1545},{"style":141},[1546],{"type":45,"value":1547}," sendEmail",{"type":39,"tag":122,"props":1549,"children":1550},{"style":135},[1551],{"type":45,"value":149},{"type":39,"tag":122,"props":1553,"children":1554},{"style":129},[1555],{"type":45,"value":154},{"type":39,"tag":122,"props":1557,"children":1558},{"style":135},[1559],{"type":45,"value":159},{"type":39,"tag":122,"props":1561,"children":1562},{"style":162},[1563],{"type":45,"value":1564},".\u002Femail",{"type":39,"tag":122,"props":1566,"children":1567},{"style":135},[1568],{"type":45,"value":169},{"type":39,"tag":122,"props":1570,"children":1571},{"style":135},[1572],{"type":45,"value":174},{"type":39,"tag":122,"props":1574,"children":1575},{"class":124,"line":229},[1576],{"type":39,"tag":122,"props":1577,"children":1578},{"emptyLinePlaceholder":223},[1579],{"type":45,"value":226},{"type":39,"tag":122,"props":1581,"children":1582},{"class":124,"line":269},[1583,1587,1591,1595,1599,1603,1607],{"type":39,"tag":122,"props":1584,"children":1585},{"style":129},[1586],{"type":45,"value":235},{"type":39,"tag":122,"props":1588,"children":1589},{"style":238},[1590],{"type":45,"value":241},{"type":39,"tag":122,"props":1592,"children":1593},{"style":141},[1594],{"type":45,"value":246},{"type":39,"tag":122,"props":1596,"children":1597},{"style":135},[1598],{"type":45,"value":251},{"type":39,"tag":122,"props":1600,"children":1601},{"style":254},[1602],{"type":45,"value":144},{"type":39,"tag":122,"props":1604,"children":1605},{"style":141},[1606],{"type":45,"value":261},{"type":39,"tag":122,"props":1608,"children":1609},{"style":135},[1610],{"type":45,"value":266},{"type":39,"tag":122,"props":1612,"children":1613},{"class":124,"line":302},[1614,1618,1622],{"type":39,"tag":122,"props":1615,"children":1616},{"style":273},[1617],{"type":45,"value":308},{"type":39,"tag":122,"props":1619,"children":1620},{"style":135},[1621],{"type":45,"value":281},{"type":39,"tag":122,"props":1623,"children":1624},{"style":141},[1625],{"type":45,"value":317},{"type":39,"tag":122,"props":1627,"children":1628},{"class":124,"line":320},[1629,1633,1637],{"type":39,"tag":122,"props":1630,"children":1631},{"style":254},[1632],{"type":45,"value":326},{"type":39,"tag":122,"props":1634,"children":1635},{"style":141},[1636],{"type":45,"value":261},{"type":39,"tag":122,"props":1638,"children":1639},{"style":135},[1640],{"type":45,"value":266},{"type":39,"tag":122,"props":1642,"children":1643},{"class":124,"line":337},[1644,1649,1653],{"type":39,"tag":122,"props":1645,"children":1646},{"style":273},[1647],{"type":45,"value":1648},"      otpOptions",{"type":39,"tag":122,"props":1650,"children":1651},{"style":135},[1652],{"type":45,"value":281},{"type":39,"tag":122,"props":1654,"children":1655},{"style":135},[1656],{"type":45,"value":595},{"type":39,"tag":122,"props":1658,"children":1659},{"class":124,"line":366},[1660,1665,1669,1673,1677,1682,1686,1691,1696,1701,1705,1709],{"type":39,"tag":122,"props":1661,"children":1662},{"style":254},[1663],{"type":45,"value":1664},"        sendOTP",{"type":39,"tag":122,"props":1666,"children":1667},{"style":135},[1668],{"type":45,"value":281},{"type":39,"tag":122,"props":1670,"children":1671},{"style":238},[1672],{"type":45,"value":735},{"type":39,"tag":122,"props":1674,"children":1675},{"style":135},[1676],{"type":45,"value":1044},{"type":39,"tag":122,"props":1678,"children":1679},{"style":743},[1680],{"type":45,"value":1681}," user",{"type":39,"tag":122,"props":1683,"children":1684},{"style":135},[1685],{"type":45,"value":791},{"type":39,"tag":122,"props":1687,"children":1688},{"style":743},[1689],{"type":45,"value":1690}," otp",{"type":39,"tag":122,"props":1692,"children":1693},{"style":135},[1694],{"type":45,"value":1695}," },",{"type":39,"tag":122,"props":1697,"children":1698},{"style":743},[1699],{"type":45,"value":1700}," ctx",{"type":39,"tag":122,"props":1702,"children":1703},{"style":135},[1704],{"type":45,"value":377},{"type":39,"tag":122,"props":1706,"children":1707},{"style":238},[1708],{"type":45,"value":765},{"type":39,"tag":122,"props":1710,"children":1711},{"style":135},[1712],{"type":45,"value":595},{"type":39,"tag":122,"props":1714,"children":1715},{"class":124,"line":384},[1716,1721,1725,1729],{"type":39,"tag":122,"props":1717,"children":1718},{"style":129},[1719],{"type":45,"value":1720},"          await",{"type":39,"tag":122,"props":1722,"children":1723},{"style":254},[1724],{"type":45,"value":1547},{"type":39,"tag":122,"props":1726,"children":1727},{"style":273},[1728],{"type":45,"value":261},{"type":39,"tag":122,"props":1730,"children":1731},{"style":135},[1732],{"type":45,"value":266},{"type":39,"tag":122,"props":1734,"children":1735},{"class":124,"line":397},[1736,1741,1745,1749,1753,1758],{"type":39,"tag":122,"props":1737,"children":1738},{"style":273},[1739],{"type":45,"value":1740},"            to",{"type":39,"tag":122,"props":1742,"children":1743},{"style":135},[1744],{"type":45,"value":281},{"type":39,"tag":122,"props":1746,"children":1747},{"style":141},[1748],{"type":45,"value":1681},{"type":39,"tag":122,"props":1750,"children":1751},{"style":135},[1752],{"type":45,"value":608},{"type":39,"tag":122,"props":1754,"children":1755},{"style":141},[1756],{"type":45,"value":1757},"email",{"type":39,"tag":122,"props":1759,"children":1760},{"style":135},[1761],{"type":45,"value":299},{"type":39,"tag":122,"props":1763,"children":1764},{"class":124,"line":681},[1765,1770,1774,1778,1783,1787],{"type":39,"tag":122,"props":1766,"children":1767},{"style":273},[1768],{"type":45,"value":1769},"            subject",{"type":39,"tag":122,"props":1771,"children":1772},{"style":135},[1773],{"type":45,"value":281},{"type":39,"tag":122,"props":1775,"children":1776},{"style":135},[1777],{"type":45,"value":159},{"type":39,"tag":122,"props":1779,"children":1780},{"style":162},[1781],{"type":45,"value":1782},"Your verification code",{"type":39,"tag":122,"props":1784,"children":1785},{"style":135},[1786],{"type":45,"value":169},{"type":39,"tag":122,"props":1788,"children":1789},{"style":135},[1790],{"type":45,"value":299},{"type":39,"tag":122,"props":1792,"children":1794},{"class":124,"line":1793},13,[1795,1800,1804,1809,1814,1819,1824,1829],{"type":39,"tag":122,"props":1796,"children":1797},{"style":273},[1798],{"type":45,"value":1799},"            text",{"type":39,"tag":122,"props":1801,"children":1802},{"style":135},[1803],{"type":45,"value":281},{"type":39,"tag":122,"props":1805,"children":1806},{"style":135},[1807],{"type":45,"value":1808}," `",{"type":39,"tag":122,"props":1810,"children":1811},{"style":162},[1812],{"type":45,"value":1813},"Your code is: ",{"type":39,"tag":122,"props":1815,"children":1816},{"style":135},[1817],{"type":45,"value":1818},"${",{"type":39,"tag":122,"props":1820,"children":1821},{"style":141},[1822],{"type":45,"value":1823},"otp",{"type":39,"tag":122,"props":1825,"children":1826},{"style":135},[1827],{"type":45,"value":1828},"}`",{"type":39,"tag":122,"props":1830,"children":1831},{"style":135},[1832],{"type":45,"value":299},{"type":39,"tag":122,"props":1834,"children":1836},{"class":124,"line":1835},14,[1837,1842,1846],{"type":39,"tag":122,"props":1838,"children":1839},{"style":135},[1840],{"type":45,"value":1841},"          }",{"type":39,"tag":122,"props":1843,"children":1844},{"style":273},[1845],{"type":45,"value":377},{"type":39,"tag":122,"props":1847,"children":1848},{"style":135},[1849],{"type":45,"value":174},{"type":39,"tag":122,"props":1851,"children":1853},{"class":124,"line":1852},15,[1854],{"type":39,"tag":122,"props":1855,"children":1856},{"style":135},[1857],{"type":45,"value":1858},"        },\n",{"type":39,"tag":122,"props":1860,"children":1862},{"class":124,"line":1861},16,[1863,1868,1872,1877,1881],{"type":39,"tag":122,"props":1864,"children":1865},{"style":273},[1866],{"type":45,"value":1867},"        period",{"type":39,"tag":122,"props":1869,"children":1870},{"style":135},[1871],{"type":45,"value":281},{"type":39,"tag":122,"props":1873,"children":1874},{"style":1373},[1875],{"type":45,"value":1876}," 5",{"type":39,"tag":122,"props":1878,"children":1879},{"style":135},[1880],{"type":45,"value":791},{"type":39,"tag":122,"props":1882,"children":1883},{"style":907},[1884],{"type":45,"value":1885}," \u002F\u002F Code validity in minutes (default: 3)\n",{"type":39,"tag":122,"props":1887,"children":1889},{"class":124,"line":1888},17,[1890,1895,1899,1903,1907],{"type":39,"tag":122,"props":1891,"children":1892},{"style":273},[1893],{"type":45,"value":1894},"        digits",{"type":39,"tag":122,"props":1896,"children":1897},{"style":135},[1898],{"type":45,"value":281},{"type":39,"tag":122,"props":1900,"children":1901},{"style":1373},[1902],{"type":45,"value":1376},{"type":39,"tag":122,"props":1904,"children":1905},{"style":135},[1906],{"type":45,"value":791},{"type":39,"tag":122,"props":1908,"children":1909},{"style":907},[1910],{"type":45,"value":1911}," \u002F\u002F Number of digits (default: 6)\n",{"type":39,"tag":122,"props":1913,"children":1915},{"class":124,"line":1914},18,[1916,1921,1925,1929,1933],{"type":39,"tag":122,"props":1917,"children":1918},{"style":273},[1919],{"type":45,"value":1920},"        allowedAttempts",{"type":39,"tag":122,"props":1922,"children":1923},{"style":135},[1924],{"type":45,"value":281},{"type":39,"tag":122,"props":1926,"children":1927},{"style":1373},[1928],{"type":45,"value":1876},{"type":39,"tag":122,"props":1930,"children":1931},{"style":135},[1932],{"type":45,"value":791},{"type":39,"tag":122,"props":1934,"children":1935},{"style":907},[1936],{"type":45,"value":1937}," \u002F\u002F Max verification attempts (default: 5)\n",{"type":39,"tag":122,"props":1939,"children":1941},{"class":124,"line":1940},19,[1942],{"type":39,"tag":122,"props":1943,"children":1944},{"style":135},[1945],{"type":45,"value":652},{"type":39,"tag":122,"props":1947,"children":1949},{"class":124,"line":1948},20,[1950,1954,1958],{"type":39,"tag":122,"props":1951,"children":1952},{"style":135},[1953],{"type":45,"value":372},{"type":39,"tag":122,"props":1955,"children":1956},{"style":141},[1957],{"type":45,"value":377},{"type":39,"tag":122,"props":1959,"children":1960},{"style":135},[1961],{"type":45,"value":299},{"type":39,"tag":122,"props":1963,"children":1965},{"class":124,"line":1964},21,[1966,1970],{"type":39,"tag":122,"props":1967,"children":1968},{"style":141},[1969],{"type":45,"value":390},{"type":39,"tag":122,"props":1971,"children":1972},{"style":135},[1973],{"type":45,"value":299},{"type":39,"tag":122,"props":1975,"children":1977},{"class":124,"line":1976},22,[1978,1982,1986],{"type":39,"tag":122,"props":1979,"children":1980},{"style":135},[1981],{"type":45,"value":403},{"type":39,"tag":122,"props":1983,"children":1984},{"style":141},[1985],{"type":45,"value":377},{"type":39,"tag":122,"props":1987,"children":1988},{"style":135},[1989],{"type":45,"value":174},{"type":39,"tag":413,"props":1991,"children":1993},{"id":1992},"sending-and-verifying-otp",[1994],{"type":45,"value":1995},"Sending and Verifying OTP",{"type":39,"tag":702,"props":1997,"children":1998},{},[1999,2001,2007,2009,2015],{"type":45,"value":2000},"Send: ",{"type":39,"tag":58,"props":2002,"children":2004},{"className":2003},[],[2005],{"type":45,"value":2006},"authClient.twoFactor.sendOtp()",{"type":45,"value":2008},". Verify: ",{"type":39,"tag":58,"props":2010,"children":2012},{"className":2011},[],[2013],{"type":45,"value":2014},"authClient.twoFactor.verifyOtp({ code, trustDevice: true })",{"type":45,"value":608},{"type":39,"tag":413,"props":2017,"children":2019},{"id":2018},"otp-storage-security",[2020],{"type":45,"value":2021},"OTP Storage Security",{"type":39,"tag":702,"props":2023,"children":2024},{},[2025],{"type":45,"value":2026},"Configure how OTP codes are stored in the database:",{"type":39,"tag":111,"props":2028,"children":2030},{"className":113,"code":2029,"language":115,"meta":116,"style":116},"twoFactor({\n  otpOptions: {\n    storeOTP: \"encrypted\", \u002F\u002F Options: \"plain\", \"encrypted\", \"hashed\"\n  },\n});\n",[2031],{"type":39,"tag":58,"props":2032,"children":2033},{"__ignoreMap":116},[2034,2049,2065,2099,2106],{"type":39,"tag":122,"props":2035,"children":2036},{"class":124,"line":125},[2037,2041,2045],{"type":39,"tag":122,"props":2038,"children":2039},{"style":254},[2040],{"type":45,"value":823},{"type":39,"tag":122,"props":2042,"children":2043},{"style":141},[2044],{"type":45,"value":261},{"type":39,"tag":122,"props":2046,"children":2047},{"style":135},[2048],{"type":45,"value":266},{"type":39,"tag":122,"props":2050,"children":2051},{"class":124,"line":177},[2052,2057,2061],{"type":39,"tag":122,"props":2053,"children":2054},{"style":273},[2055],{"type":45,"value":2056},"  otpOptions",{"type":39,"tag":122,"props":2058,"children":2059},{"style":135},[2060],{"type":45,"value":281},{"type":39,"tag":122,"props":2062,"children":2063},{"style":135},[2064],{"type":45,"value":595},{"type":39,"tag":122,"props":2066,"children":2067},{"class":124,"line":219},[2068,2073,2077,2081,2086,2090,2094],{"type":39,"tag":122,"props":2069,"children":2070},{"style":273},[2071],{"type":45,"value":2072},"    storeOTP",{"type":39,"tag":122,"props":2074,"children":2075},{"style":135},[2076],{"type":45,"value":281},{"type":39,"tag":122,"props":2078,"children":2079},{"style":135},[2080],{"type":45,"value":159},{"type":39,"tag":122,"props":2082,"children":2083},{"style":162},[2084],{"type":45,"value":2085},"encrypted",{"type":39,"tag":122,"props":2087,"children":2088},{"style":135},[2089],{"type":45,"value":169},{"type":39,"tag":122,"props":2091,"children":2092},{"style":135},[2093],{"type":45,"value":791},{"type":39,"tag":122,"props":2095,"children":2096},{"style":907},[2097],{"type":45,"value":2098}," \u002F\u002F Options: \"plain\", \"encrypted\", \"hashed\"\n",{"type":39,"tag":122,"props":2100,"children":2101},{"class":124,"line":229},[2102],{"type":39,"tag":122,"props":2103,"children":2104},{"style":135},[2105],{"type":45,"value":1419},{"type":39,"tag":122,"props":2107,"children":2108},{"class":124,"line":269},[2109,2113,2117],{"type":39,"tag":122,"props":2110,"children":2111},{"style":135},[2112],{"type":45,"value":403},{"type":39,"tag":122,"props":2114,"children":2115},{"style":141},[2116],{"type":45,"value":377},{"type":39,"tag":122,"props":2118,"children":2119},{"style":135},[2120],{"type":45,"value":174},{"type":39,"tag":702,"props":2122,"children":2123},{},[2124],{"type":45,"value":2125},"For custom encryption:",{"type":39,"tag":111,"props":2127,"children":2129},{"className":113,"code":2128,"language":115,"meta":116,"style":116},"twoFactor({\n  otpOptions: {\n    storeOTP: {\n      encrypt: async (token) => myEncrypt(token),\n      decrypt: async (token) => myDecrypt(token),\n    },\n  },\n});\n",[2130],{"type":39,"tag":58,"props":2131,"children":2132},{"__ignoreMap":116},[2133,2148,2163,2178,2225,2270,2278,2285],{"type":39,"tag":122,"props":2134,"children":2135},{"class":124,"line":125},[2136,2140,2144],{"type":39,"tag":122,"props":2137,"children":2138},{"style":254},[2139],{"type":45,"value":823},{"type":39,"tag":122,"props":2141,"children":2142},{"style":141},[2143],{"type":45,"value":261},{"type":39,"tag":122,"props":2145,"children":2146},{"style":135},[2147],{"type":45,"value":266},{"type":39,"tag":122,"props":2149,"children":2150},{"class":124,"line":177},[2151,2155,2159],{"type":39,"tag":122,"props":2152,"children":2153},{"style":273},[2154],{"type":45,"value":2056},{"type":39,"tag":122,"props":2156,"children":2157},{"style":135},[2158],{"type":45,"value":281},{"type":39,"tag":122,"props":2160,"children":2161},{"style":135},[2162],{"type":45,"value":595},{"type":39,"tag":122,"props":2164,"children":2165},{"class":124,"line":219},[2166,2170,2174],{"type":39,"tag":122,"props":2167,"children":2168},{"style":273},[2169],{"type":45,"value":2072},{"type":39,"tag":122,"props":2171,"children":2172},{"style":135},[2173],{"type":45,"value":281},{"type":39,"tag":122,"props":2175,"children":2176},{"style":135},[2177],{"type":45,"value":595},{"type":39,"tag":122,"props":2179,"children":2180},{"class":124,"line":229},[2181,2186,2190,2194,2198,2203,2207,2211,2216,2221],{"type":39,"tag":122,"props":2182,"children":2183},{"style":254},[2184],{"type":45,"value":2185},"      encrypt",{"type":39,"tag":122,"props":2187,"children":2188},{"style":135},[2189],{"type":45,"value":281},{"type":39,"tag":122,"props":2191,"children":2192},{"style":238},[2193],{"type":45,"value":735},{"type":39,"tag":122,"props":2195,"children":2196},{"style":135},[2197],{"type":45,"value":740},{"type":39,"tag":122,"props":2199,"children":2200},{"style":743},[2201],{"type":45,"value":2202},"token",{"type":39,"tag":122,"props":2204,"children":2205},{"style":135},[2206],{"type":45,"value":377},{"type":39,"tag":122,"props":2208,"children":2209},{"style":238},[2210],{"type":45,"value":765},{"type":39,"tag":122,"props":2212,"children":2213},{"style":254},[2214],{"type":45,"value":2215}," myEncrypt",{"type":39,"tag":122,"props":2217,"children":2218},{"style":141},[2219],{"type":45,"value":2220},"(token)",{"type":39,"tag":122,"props":2222,"children":2223},{"style":135},[2224],{"type":45,"value":299},{"type":39,"tag":122,"props":2226,"children":2227},{"class":124,"line":269},[2228,2233,2237,2241,2245,2249,2253,2257,2262,2266],{"type":39,"tag":122,"props":2229,"children":2230},{"style":254},[2231],{"type":45,"value":2232},"      decrypt",{"type":39,"tag":122,"props":2234,"children":2235},{"style":135},[2236],{"type":45,"value":281},{"type":39,"tag":122,"props":2238,"children":2239},{"style":238},[2240],{"type":45,"value":735},{"type":39,"tag":122,"props":2242,"children":2243},{"style":135},[2244],{"type":45,"value":740},{"type":39,"tag":122,"props":2246,"children":2247},{"style":743},[2248],{"type":45,"value":2202},{"type":39,"tag":122,"props":2250,"children":2251},{"style":135},[2252],{"type":45,"value":377},{"type":39,"tag":122,"props":2254,"children":2255},{"style":238},[2256],{"type":45,"value":765},{"type":39,"tag":122,"props":2258,"children":2259},{"style":254},[2260],{"type":45,"value":2261}," myDecrypt",{"type":39,"tag":122,"props":2263,"children":2264},{"style":141},[2265],{"type":45,"value":2220},{"type":39,"tag":122,"props":2267,"children":2268},{"style":135},[2269],{"type":45,"value":299},{"type":39,"tag":122,"props":2271,"children":2272},{"class":124,"line":302},[2273],{"type":39,"tag":122,"props":2274,"children":2275},{"style":135},[2276],{"type":45,"value":2277},"    },\n",{"type":39,"tag":122,"props":2279,"children":2280},{"class":124,"line":320},[2281],{"type":39,"tag":122,"props":2282,"children":2283},{"style":135},[2284],{"type":45,"value":1419},{"type":39,"tag":122,"props":2286,"children":2287},{"class":124,"line":337},[2288,2292,2296],{"type":39,"tag":122,"props":2289,"children":2290},{"style":135},[2291],{"type":45,"value":403},{"type":39,"tag":122,"props":2293,"children":2294},{"style":141},[2295],{"type":45,"value":377},{"type":39,"tag":122,"props":2297,"children":2298},{"style":135},[2299],{"type":45,"value":174},{"type":39,"tag":40,"props":2301,"children":2303},{"id":2302},"backup-codes",[2304],{"type":45,"value":2305},"Backup Codes",{"type":39,"tag":702,"props":2307,"children":2308},{},[2309],{"type":45,"value":2310},"Generated automatically when 2FA is enabled. Each code is single-use.",{"type":39,"tag":413,"props":2312,"children":2314},{"id":2313},"displaying-backup-codes",[2315],{"type":45,"value":2316},"Displaying Backup Codes",{"type":39,"tag":111,"props":2318,"children":2320},{"className":976,"code":2319,"language":978,"meta":116,"style":116},"const BackupCodes = ({ codes }: { codes: string[] }) => {\n  return (\n    \u003Cdiv>\n      \u003Cp>Save these codes in a secure location:\u003C\u002Fp>\n      \u003Cul>\n        {codes.map((code, i) => (\n          \u003Cli key={i}>{code}\u003C\u002Fli>\n        ))}\n      \u003C\u002Ful>\n    \u003C\u002Fdiv>\n  );\n};\n",[2321],{"type":39,"tag":58,"props":2322,"children":2323},{"__ignoreMap":116},[2324,2387,2399,2417,2452,2468,2523,2571,2584,2600,2616,2628],{"type":39,"tag":122,"props":2325,"children":2326},{"class":124,"line":125},[2327,2331,2336,2340,2344,2349,2353,2357,2361,2365,2369,2374,2379,2383],{"type":39,"tag":122,"props":2328,"children":2329},{"style":238},[2330],{"type":45,"value":721},{"type":39,"tag":122,"props":2332,"children":2333},{"style":141},[2334],{"type":45,"value":2335}," BackupCodes ",{"type":39,"tag":122,"props":2337,"children":2338},{"style":135},[2339],{"type":45,"value":251},{"type":39,"tag":122,"props":2341,"children":2342},{"style":135},[2343],{"type":45,"value":1044},{"type":39,"tag":122,"props":2345,"children":2346},{"style":743},[2347],{"type":45,"value":2348}," codes",{"type":39,"tag":122,"props":2350,"children":2351},{"style":135},[2352],{"type":45,"value":1054},{"type":39,"tag":122,"props":2354,"children":2355},{"style":135},[2356],{"type":45,"value":138},{"type":39,"tag":122,"props":2358,"children":2359},{"style":273},[2360],{"type":45,"value":2348},{"type":39,"tag":122,"props":2362,"children":2363},{"style":135},[2364],{"type":45,"value":281},{"type":39,"tag":122,"props":2366,"children":2367},{"style":753},[2368],{"type":45,"value":756},{"type":39,"tag":122,"props":2370,"children":2371},{"style":141},[2372],{"type":45,"value":2373},"[] ",{"type":39,"tag":122,"props":2375,"children":2376},{"style":135},[2377],{"type":45,"value":2378},"})",{"type":39,"tag":122,"props":2380,"children":2381},{"style":238},[2382],{"type":45,"value":765},{"type":39,"tag":122,"props":2384,"children":2385},{"style":135},[2386],{"type":45,"value":595},{"type":39,"tag":122,"props":2388,"children":2389},{"class":124,"line":177},[2390,2394],{"type":39,"tag":122,"props":2391,"children":2392},{"style":129},[2393],{"type":45,"value":1091},{"type":39,"tag":122,"props":2395,"children":2396},{"style":273},[2397],{"type":45,"value":2398}," (\n",{"type":39,"tag":122,"props":2400,"children":2401},{"class":124,"line":219},[2402,2407,2412],{"type":39,"tag":122,"props":2403,"children":2404},{"style":135},[2405],{"type":45,"value":2406},"    \u003C",{"type":39,"tag":122,"props":2408,"children":2409},{"style":273},[2410],{"type":45,"value":2411},"div",{"type":39,"tag":122,"props":2413,"children":2414},{"style":135},[2415],{"type":45,"value":2416},">\n",{"type":39,"tag":122,"props":2418,"children":2419},{"class":124,"line":229},[2420,2425,2429,2434,2439,2444,2448],{"type":39,"tag":122,"props":2421,"children":2422},{"style":135},[2423],{"type":45,"value":2424},"      \u003C",{"type":39,"tag":122,"props":2426,"children":2427},{"style":273},[2428],{"type":45,"value":702},{"type":39,"tag":122,"props":2430,"children":2431},{"style":135},[2432],{"type":45,"value":2433},">",{"type":39,"tag":122,"props":2435,"children":2436},{"style":141},[2437],{"type":45,"value":2438},"Save these codes in a secure location:",{"type":39,"tag":122,"props":2440,"children":2441},{"style":135},[2442],{"type":45,"value":2443},"\u003C\u002F",{"type":39,"tag":122,"props":2445,"children":2446},{"style":273},[2447],{"type":45,"value":702},{"type":39,"tag":122,"props":2449,"children":2450},{"style":135},[2451],{"type":45,"value":2416},{"type":39,"tag":122,"props":2453,"children":2454},{"class":124,"line":269},[2455,2459,2464],{"type":39,"tag":122,"props":2456,"children":2457},{"style":135},[2458],{"type":45,"value":2424},{"type":39,"tag":122,"props":2460,"children":2461},{"style":273},[2462],{"type":45,"value":2463},"ul",{"type":39,"tag":122,"props":2465,"children":2466},{"style":135},[2467],{"type":45,"value":2416},{"type":39,"tag":122,"props":2469,"children":2470},{"class":124,"line":302},[2471,2476,2481,2485,2490,2494,2498,2502,2506,2511,2515,2519],{"type":39,"tag":122,"props":2472,"children":2473},{"style":135},[2474],{"type":45,"value":2475},"        {",{"type":39,"tag":122,"props":2477,"children":2478},{"style":141},[2479],{"type":45,"value":2480},"codes",{"type":39,"tag":122,"props":2482,"children":2483},{"style":135},[2484],{"type":45,"value":608},{"type":39,"tag":122,"props":2486,"children":2487},{"style":254},[2488],{"type":45,"value":2489},"map",{"type":39,"tag":122,"props":2491,"children":2492},{"style":141},[2493],{"type":45,"value":261},{"type":39,"tag":122,"props":2495,"children":2496},{"style":135},[2497],{"type":45,"value":261},{"type":39,"tag":122,"props":2499,"children":2500},{"style":743},[2501],{"type":45,"value":58},{"type":39,"tag":122,"props":2503,"children":2504},{"style":135},[2505],{"type":45,"value":791},{"type":39,"tag":122,"props":2507,"children":2508},{"style":743},[2509],{"type":45,"value":2510}," i",{"type":39,"tag":122,"props":2512,"children":2513},{"style":135},[2514],{"type":45,"value":377},{"type":39,"tag":122,"props":2516,"children":2517},{"style":238},[2518],{"type":45,"value":765},{"type":39,"tag":122,"props":2520,"children":2521},{"style":141},[2522],{"type":45,"value":2398},{"type":39,"tag":122,"props":2524,"children":2525},{"class":124,"line":320},[2526,2531,2535,2540,2544,2549,2554,2558,2563,2567],{"type":39,"tag":122,"props":2527,"children":2528},{"style":135},[2529],{"type":45,"value":2530},"          \u003C",{"type":39,"tag":122,"props":2532,"children":2533},{"style":273},[2534],{"type":45,"value":52},{"type":39,"tag":122,"props":2536,"children":2537},{"style":238},[2538],{"type":45,"value":2539}," key",{"type":39,"tag":122,"props":2541,"children":2542},{"style":135},[2543],{"type":45,"value":1111},{"type":39,"tag":122,"props":2545,"children":2546},{"style":141},[2547],{"type":45,"value":2548},"i",{"type":39,"tag":122,"props":2550,"children":2551},{"style":135},[2552],{"type":45,"value":2553},"}>{",{"type":39,"tag":122,"props":2555,"children":2556},{"style":141},[2557],{"type":45,"value":58},{"type":39,"tag":122,"props":2559,"children":2560},{"style":135},[2561],{"type":45,"value":2562},"}\u003C\u002F",{"type":39,"tag":122,"props":2564,"children":2565},{"style":273},[2566],{"type":45,"value":52},{"type":39,"tag":122,"props":2568,"children":2569},{"style":135},[2570],{"type":45,"value":2416},{"type":39,"tag":122,"props":2572,"children":2573},{"class":124,"line":337},[2574,2579],{"type":39,"tag":122,"props":2575,"children":2576},{"style":141},[2577],{"type":45,"value":2578},"        ))",{"type":39,"tag":122,"props":2580,"children":2581},{"style":135},[2582],{"type":45,"value":2583},"}\n",{"type":39,"tag":122,"props":2585,"children":2586},{"class":124,"line":366},[2587,2592,2596],{"type":39,"tag":122,"props":2588,"children":2589},{"style":135},[2590],{"type":45,"value":2591},"      \u003C\u002F",{"type":39,"tag":122,"props":2593,"children":2594},{"style":273},[2595],{"type":45,"value":2463},{"type":39,"tag":122,"props":2597,"children":2598},{"style":135},[2599],{"type":45,"value":2416},{"type":39,"tag":122,"props":2601,"children":2602},{"class":124,"line":384},[2603,2608,2612],{"type":39,"tag":122,"props":2604,"children":2605},{"style":135},[2606],{"type":45,"value":2607},"    \u003C\u002F",{"type":39,"tag":122,"props":2609,"children":2610},{"style":273},[2611],{"type":45,"value":2411},{"type":39,"tag":122,"props":2613,"children":2614},{"style":135},[2615],{"type":45,"value":2416},{"type":39,"tag":122,"props":2617,"children":2618},{"class":124,"line":397},[2619,2624],{"type":39,"tag":122,"props":2620,"children":2621},{"style":273},[2622],{"type":45,"value":2623},"  )",{"type":39,"tag":122,"props":2625,"children":2626},{"style":135},[2627],{"type":45,"value":174},{"type":39,"tag":122,"props":2629,"children":2630},{"class":124,"line":681},[2631],{"type":39,"tag":122,"props":2632,"children":2633},{"style":135},[2634],{"type":45,"value":934},{"type":39,"tag":413,"props":2636,"children":2638},{"id":2637},"regenerating-backup-codes",[2639],{"type":45,"value":2640},"Regenerating Backup Codes",{"type":39,"tag":702,"props":2642,"children":2643},{},[2644],{"type":45,"value":2645},"Invalidates all previous codes:",{"type":39,"tag":111,"props":2647,"children":2649},{"className":113,"code":2648,"language":115,"meta":116,"style":116},"const regenerateBackupCodes = async (password: string) => {\n  const { data, error } = await authClient.twoFactor.generateBackupCodes({\n    password,\n  });\n  \u002F\u002F data.backupCodes contains the new codes\n};\n",[2650],{"type":39,"tag":58,"props":2651,"children":2652},{"__ignoreMap":116},[2653,2701,2765,2776,2791,2799],{"type":39,"tag":122,"props":2654,"children":2655},{"class":124,"line":125},[2656,2660,2665,2669,2673,2677,2681,2685,2689,2693,2697],{"type":39,"tag":122,"props":2657,"children":2658},{"style":238},[2659],{"type":45,"value":721},{"type":39,"tag":122,"props":2661,"children":2662},{"style":141},[2663],{"type":45,"value":2664}," regenerateBackupCodes ",{"type":39,"tag":122,"props":2666,"children":2667},{"style":135},[2668],{"type":45,"value":251},{"type":39,"tag":122,"props":2670,"children":2671},{"style":238},[2672],{"type":45,"value":735},{"type":39,"tag":122,"props":2674,"children":2675},{"style":135},[2676],{"type":45,"value":740},{"type":39,"tag":122,"props":2678,"children":2679},{"style":743},[2680],{"type":45,"value":746},{"type":39,"tag":122,"props":2682,"children":2683},{"style":135},[2684],{"type":45,"value":281},{"type":39,"tag":122,"props":2686,"children":2687},{"style":753},[2688],{"type":45,"value":756},{"type":39,"tag":122,"props":2690,"children":2691},{"style":135},[2692],{"type":45,"value":377},{"type":39,"tag":122,"props":2694,"children":2695},{"style":238},[2696],{"type":45,"value":765},{"type":39,"tag":122,"props":2698,"children":2699},{"style":135},[2700],{"type":45,"value":595},{"type":39,"tag":122,"props":2702,"children":2703},{"class":124,"line":177},[2704,2708,2712,2716,2720,2724,2728,2732,2736,2740,2744,2748,2752,2757,2761],{"type":39,"tag":122,"props":2705,"children":2706},{"style":238},[2707],{"type":45,"value":777},{"type":39,"tag":122,"props":2709,"children":2710},{"style":135},[2711],{"type":45,"value":138},{"type":39,"tag":122,"props":2713,"children":2714},{"style":141},[2715],{"type":45,"value":786},{"type":39,"tag":122,"props":2717,"children":2718},{"style":135},[2719],{"type":45,"value":791},{"type":39,"tag":122,"props":2721,"children":2722},{"style":141},[2723],{"type":45,"value":796},{"type":39,"tag":122,"props":2725,"children":2726},{"style":135},[2727],{"type":45,"value":149},{"type":39,"tag":122,"props":2729,"children":2730},{"style":135},[2731],{"type":45,"value":627},{"type":39,"tag":122,"props":2733,"children":2734},{"style":129},[2735],{"type":45,"value":809},{"type":39,"tag":122,"props":2737,"children":2738},{"style":141},[2739],{"type":45,"value":814},{"type":39,"tag":122,"props":2741,"children":2742},{"style":135},[2743],{"type":45,"value":608},{"type":39,"tag":122,"props":2745,"children":2746},{"style":141},[2747],{"type":45,"value":823},{"type":39,"tag":122,"props":2749,"children":2750},{"style":135},[2751],{"type":45,"value":608},{"type":39,"tag":122,"props":2753,"children":2754},{"style":254},[2755],{"type":45,"value":2756},"generateBackupCodes",{"type":39,"tag":122,"props":2758,"children":2759},{"style":273},[2760],{"type":45,"value":261},{"type":39,"tag":122,"props":2762,"children":2763},{"style":135},[2764],{"type":45,"value":266},{"type":39,"tag":122,"props":2766,"children":2767},{"class":124,"line":219},[2768,2772],{"type":39,"tag":122,"props":2769,"children":2770},{"style":141},[2771],{"type":45,"value":848},{"type":39,"tag":122,"props":2773,"children":2774},{"style":135},[2775],{"type":45,"value":299},{"type":39,"tag":122,"props":2777,"children":2778},{"class":124,"line":229},[2779,2783,2787],{"type":39,"tag":122,"props":2780,"children":2781},{"style":135},[2782],{"type":45,"value":860},{"type":39,"tag":122,"props":2784,"children":2785},{"style":273},[2786],{"type":45,"value":377},{"type":39,"tag":122,"props":2788,"children":2789},{"style":135},[2790],{"type":45,"value":174},{"type":39,"tag":122,"props":2792,"children":2793},{"class":124,"line":269},[2794],{"type":39,"tag":122,"props":2795,"children":2796},{"style":907},[2797],{"type":45,"value":2798},"  \u002F\u002F data.backupCodes contains the new codes\n",{"type":39,"tag":122,"props":2800,"children":2801},{"class":124,"line":302},[2802],{"type":39,"tag":122,"props":2803,"children":2804},{"style":135},[2805],{"type":45,"value":934},{"type":39,"tag":413,"props":2807,"children":2809},{"id":2808},"using-backup-codes-for-recovery",[2810],{"type":45,"value":2811},"Using Backup Codes for Recovery",{"type":39,"tag":111,"props":2813,"children":2815},{"className":113,"code":2814,"language":115,"meta":116,"style":116},"const verifyBackupCode = async (code: string) => {\n  const { data, error } = await authClient.twoFactor.verifyBackupCode({\n    code,\n    trustDevice: true,\n  });\n};\n",[2816],{"type":39,"tag":58,"props":2817,"children":2818},{"__ignoreMap":116},[2819,2867,2931,2942,2961,2976],{"type":39,"tag":122,"props":2820,"children":2821},{"class":124,"line":125},[2822,2826,2831,2835,2839,2843,2847,2851,2855,2859,2863],{"type":39,"tag":122,"props":2823,"children":2824},{"style":238},[2825],{"type":45,"value":721},{"type":39,"tag":122,"props":2827,"children":2828},{"style":141},[2829],{"type":45,"value":2830}," verifyBackupCode ",{"type":39,"tag":122,"props":2832,"children":2833},{"style":135},[2834],{"type":45,"value":251},{"type":39,"tag":122,"props":2836,"children":2837},{"style":238},[2838],{"type":45,"value":735},{"type":39,"tag":122,"props":2840,"children":2841},{"style":135},[2842],{"type":45,"value":740},{"type":39,"tag":122,"props":2844,"children":2845},{"style":743},[2846],{"type":45,"value":58},{"type":39,"tag":122,"props":2848,"children":2849},{"style":135},[2850],{"type":45,"value":281},{"type":39,"tag":122,"props":2852,"children":2853},{"style":753},[2854],{"type":45,"value":756},{"type":39,"tag":122,"props":2856,"children":2857},{"style":135},[2858],{"type":45,"value":377},{"type":39,"tag":122,"props":2860,"children":2861},{"style":238},[2862],{"type":45,"value":765},{"type":39,"tag":122,"props":2864,"children":2865},{"style":135},[2866],{"type":45,"value":595},{"type":39,"tag":122,"props":2868,"children":2869},{"class":124,"line":177},[2870,2874,2878,2882,2886,2890,2894,2898,2902,2906,2910,2914,2918,2923,2927],{"type":39,"tag":122,"props":2871,"children":2872},{"style":238},[2873],{"type":45,"value":777},{"type":39,"tag":122,"props":2875,"children":2876},{"style":135},[2877],{"type":45,"value":138},{"type":39,"tag":122,"props":2879,"children":2880},{"style":141},[2881],{"type":45,"value":786},{"type":39,"tag":122,"props":2883,"children":2884},{"style":135},[2885],{"type":45,"value":791},{"type":39,"tag":122,"props":2887,"children":2888},{"style":141},[2889],{"type":45,"value":796},{"type":39,"tag":122,"props":2891,"children":2892},{"style":135},[2893],{"type":45,"value":149},{"type":39,"tag":122,"props":2895,"children":2896},{"style":135},[2897],{"type":45,"value":627},{"type":39,"tag":122,"props":2899,"children":2900},{"style":129},[2901],{"type":45,"value":809},{"type":39,"tag":122,"props":2903,"children":2904},{"style":141},[2905],{"type":45,"value":814},{"type":39,"tag":122,"props":2907,"children":2908},{"style":135},[2909],{"type":45,"value":608},{"type":39,"tag":122,"props":2911,"children":2912},{"style":141},[2913],{"type":45,"value":823},{"type":39,"tag":122,"props":2915,"children":2916},{"style":135},[2917],{"type":45,"value":608},{"type":39,"tag":122,"props":2919,"children":2920},{"style":254},[2921],{"type":45,"value":2922},"verifyBackupCode",{"type":39,"tag":122,"props":2924,"children":2925},{"style":273},[2926],{"type":45,"value":261},{"type":39,"tag":122,"props":2928,"children":2929},{"style":135},[2930],{"type":45,"value":266},{"type":39,"tag":122,"props":2932,"children":2933},{"class":124,"line":219},[2934,2938],{"type":39,"tag":122,"props":2935,"children":2936},{"style":141},[2937],{"type":45,"value":1266},{"type":39,"tag":122,"props":2939,"children":2940},{"style":135},[2941],{"type":45,"value":299},{"type":39,"tag":122,"props":2943,"children":2944},{"class":124,"line":229},[2945,2949,2953,2957],{"type":39,"tag":122,"props":2946,"children":2947},{"style":273},[2948],{"type":45,"value":1278},{"type":39,"tag":122,"props":2950,"children":2951},{"style":135},[2952],{"type":45,"value":281},{"type":39,"tag":122,"props":2954,"children":2955},{"style":1285},[2956],{"type":45,"value":1288},{"type":39,"tag":122,"props":2958,"children":2959},{"style":135},[2960],{"type":45,"value":299},{"type":39,"tag":122,"props":2962,"children":2963},{"class":124,"line":269},[2964,2968,2972],{"type":39,"tag":122,"props":2965,"children":2966},{"style":135},[2967],{"type":45,"value":860},{"type":39,"tag":122,"props":2969,"children":2970},{"style":273},[2971],{"type":45,"value":377},{"type":39,"tag":122,"props":2973,"children":2974},{"style":135},[2975],{"type":45,"value":174},{"type":39,"tag":122,"props":2977,"children":2978},{"class":124,"line":302},[2979],{"type":39,"tag":122,"props":2980,"children":2981},{"style":135},[2982],{"type":45,"value":934},{"type":39,"tag":413,"props":2984,"children":2986},{"id":2985},"backup-code-configuration",[2987],{"type":45,"value":2988},"Backup Code Configuration",{"type":39,"tag":111,"props":2990,"children":2992},{"className":113,"code":2991,"language":115,"meta":116,"style":116},"twoFactor({\n  backupCodeOptions: {\n    amount: 10, \u002F\u002F Number of codes to generate (default: 10)\n    length: 10, \u002F\u002F Length of each code (default: 10)\n    storeBackupCodes: \"encrypted\", \u002F\u002F Options: \"plain\", \"encrypted\"\n  },\n});\n",[2993],{"type":39,"tag":58,"props":2994,"children":2995},{"__ignoreMap":116},[2996,3011,3027,3053,3078,3111,3118],{"type":39,"tag":122,"props":2997,"children":2998},{"class":124,"line":125},[2999,3003,3007],{"type":39,"tag":122,"props":3000,"children":3001},{"style":254},[3002],{"type":45,"value":823},{"type":39,"tag":122,"props":3004,"children":3005},{"style":141},[3006],{"type":45,"value":261},{"type":39,"tag":122,"props":3008,"children":3009},{"style":135},[3010],{"type":45,"value":266},{"type":39,"tag":122,"props":3012,"children":3013},{"class":124,"line":177},[3014,3019,3023],{"type":39,"tag":122,"props":3015,"children":3016},{"style":273},[3017],{"type":45,"value":3018},"  backupCodeOptions",{"type":39,"tag":122,"props":3020,"children":3021},{"style":135},[3022],{"type":45,"value":281},{"type":39,"tag":122,"props":3024,"children":3025},{"style":135},[3026],{"type":45,"value":595},{"type":39,"tag":122,"props":3028,"children":3029},{"class":124,"line":219},[3030,3035,3039,3044,3048],{"type":39,"tag":122,"props":3031,"children":3032},{"style":273},[3033],{"type":45,"value":3034},"    amount",{"type":39,"tag":122,"props":3036,"children":3037},{"style":135},[3038],{"type":45,"value":281},{"type":39,"tag":122,"props":3040,"children":3041},{"style":1373},[3042],{"type":45,"value":3043}," 10",{"type":39,"tag":122,"props":3045,"children":3046},{"style":135},[3047],{"type":45,"value":791},{"type":39,"tag":122,"props":3049,"children":3050},{"style":907},[3051],{"type":45,"value":3052}," \u002F\u002F Number of codes to generate (default: 10)\n",{"type":39,"tag":122,"props":3054,"children":3055},{"class":124,"line":229},[3056,3061,3065,3069,3073],{"type":39,"tag":122,"props":3057,"children":3058},{"style":273},[3059],{"type":45,"value":3060},"    length",{"type":39,"tag":122,"props":3062,"children":3063},{"style":135},[3064],{"type":45,"value":281},{"type":39,"tag":122,"props":3066,"children":3067},{"style":1373},[3068],{"type":45,"value":3043},{"type":39,"tag":122,"props":3070,"children":3071},{"style":135},[3072],{"type":45,"value":791},{"type":39,"tag":122,"props":3074,"children":3075},{"style":907},[3076],{"type":45,"value":3077}," \u002F\u002F Length of each code (default: 10)\n",{"type":39,"tag":122,"props":3079,"children":3080},{"class":124,"line":269},[3081,3086,3090,3094,3098,3102,3106],{"type":39,"tag":122,"props":3082,"children":3083},{"style":273},[3084],{"type":45,"value":3085},"    storeBackupCodes",{"type":39,"tag":122,"props":3087,"children":3088},{"style":135},[3089],{"type":45,"value":281},{"type":39,"tag":122,"props":3091,"children":3092},{"style":135},[3093],{"type":45,"value":159},{"type":39,"tag":122,"props":3095,"children":3096},{"style":162},[3097],{"type":45,"value":2085},{"type":39,"tag":122,"props":3099,"children":3100},{"style":135},[3101],{"type":45,"value":169},{"type":39,"tag":122,"props":3103,"children":3104},{"style":135},[3105],{"type":45,"value":791},{"type":39,"tag":122,"props":3107,"children":3108},{"style":907},[3109],{"type":45,"value":3110}," \u002F\u002F Options: \"plain\", \"encrypted\"\n",{"type":39,"tag":122,"props":3112,"children":3113},{"class":124,"line":302},[3114],{"type":39,"tag":122,"props":3115,"children":3116},{"style":135},[3117],{"type":45,"value":1419},{"type":39,"tag":122,"props":3119,"children":3120},{"class":124,"line":320},[3121,3125,3129],{"type":39,"tag":122,"props":3122,"children":3123},{"style":135},[3124],{"type":45,"value":403},{"type":39,"tag":122,"props":3126,"children":3127},{"style":141},[3128],{"type":45,"value":377},{"type":39,"tag":122,"props":3130,"children":3131},{"style":135},[3132],{"type":45,"value":174},{"type":39,"tag":40,"props":3134,"children":3136},{"id":3135},"handling-2fa-during-sign-in",[3137],{"type":45,"value":3138},"Handling 2FA During Sign-In",{"type":39,"tag":702,"props":3140,"children":3141},{},[3142,3144,3150],{"type":45,"value":3143},"Response includes ",{"type":39,"tag":58,"props":3145,"children":3147},{"className":3146},[],[3148],{"type":45,"value":3149},"twoFactorRedirect: true",{"type":45,"value":3151}," when 2FA is required:",{"type":39,"tag":413,"props":3153,"children":3155},{"id":3154},"sign-in-flow",[3156],{"type":45,"value":3157},"Sign-In Flow",{"type":39,"tag":48,"props":3159,"children":3160},{},[3161,3172,3191,3210,3215],{"type":39,"tag":52,"props":3162,"children":3163},{},[3164,3166],{"type":45,"value":3165},"Call ",{"type":39,"tag":58,"props":3167,"children":3169},{"className":3168},[],[3170],{"type":45,"value":3171},"signIn.email({ email, password })",{"type":39,"tag":52,"props":3173,"children":3174},{},[3175,3177,3183,3185],{"type":45,"value":3176},"Check ",{"type":39,"tag":58,"props":3178,"children":3180},{"className":3179},[],[3181],{"type":45,"value":3182},"context.data.twoFactorRedirect",{"type":45,"value":3184}," in ",{"type":39,"tag":58,"props":3186,"children":3188},{"className":3187},[],[3189],{"type":45,"value":3190},"onSuccess",{"type":39,"tag":52,"props":3192,"children":3193},{},[3194,3196,3201,3203,3208],{"type":45,"value":3195},"If ",{"type":39,"tag":58,"props":3197,"children":3199},{"className":3198},[],[3200],{"type":45,"value":951},{"type":45,"value":3202},", redirect to ",{"type":39,"tag":58,"props":3204,"children":3206},{"className":3205},[],[3207],{"type":45,"value":636},{"type":45,"value":3209}," verification page",{"type":39,"tag":52,"props":3211,"children":3212},{},[3213],{"type":45,"value":3214},"Verify via TOTP, OTP, or backup code",{"type":39,"tag":52,"props":3216,"children":3217},{},[3218],{"type":45,"value":3219},"Session cookie is created on successful verification",{"type":39,"tag":111,"props":3221,"children":3223},{"className":113,"code":3222,"language":115,"meta":116,"style":116},"const signIn = async (email: string, password: string) => {\n  const { data, error } = await authClient.signIn.email(\n    { email, password },\n    {\n      onSuccess(context) {\n        if (context.data.twoFactorRedirect) {\n          window.location.href = \"\u002F2fa\";\n        }\n      },\n    }\n  );\n};\n",[3224],{"type":39,"tag":58,"props":3225,"children":3226},{"__ignoreMap":116},[3227,3292,3353,3379,3387,3412,3453,3497,3505,3512,3520,3531],{"type":39,"tag":122,"props":3228,"children":3229},{"class":124,"line":125},[3230,3234,3239,3243,3247,3251,3255,3259,3263,3267,3272,3276,3280,3284,3288],{"type":39,"tag":122,"props":3231,"children":3232},{"style":238},[3233],{"type":45,"value":721},{"type":39,"tag":122,"props":3235,"children":3236},{"style":141},[3237],{"type":45,"value":3238}," signIn ",{"type":39,"tag":122,"props":3240,"children":3241},{"style":135},[3242],{"type":45,"value":251},{"type":39,"tag":122,"props":3244,"children":3245},{"style":238},[3246],{"type":45,"value":735},{"type":39,"tag":122,"props":3248,"children":3249},{"style":135},[3250],{"type":45,"value":740},{"type":39,"tag":122,"props":3252,"children":3253},{"style":743},[3254],{"type":45,"value":1757},{"type":39,"tag":122,"props":3256,"children":3257},{"style":135},[3258],{"type":45,"value":281},{"type":39,"tag":122,"props":3260,"children":3261},{"style":753},[3262],{"type":45,"value":756},{"type":39,"tag":122,"props":3264,"children":3265},{"style":135},[3266],{"type":45,"value":791},{"type":39,"tag":122,"props":3268,"children":3269},{"style":743},[3270],{"type":45,"value":3271}," password",{"type":39,"tag":122,"props":3273,"children":3274},{"style":135},[3275],{"type":45,"value":281},{"type":39,"tag":122,"props":3277,"children":3278},{"style":753},[3279],{"type":45,"value":756},{"type":39,"tag":122,"props":3281,"children":3282},{"style":135},[3283],{"type":45,"value":377},{"type":39,"tag":122,"props":3285,"children":3286},{"style":238},[3287],{"type":45,"value":765},{"type":39,"tag":122,"props":3289,"children":3290},{"style":135},[3291],{"type":45,"value":595},{"type":39,"tag":122,"props":3293,"children":3294},{"class":124,"line":177},[3295,3299,3303,3307,3311,3315,3319,3323,3327,3331,3335,3340,3344,3348],{"type":39,"tag":122,"props":3296,"children":3297},{"style":238},[3298],{"type":45,"value":777},{"type":39,"tag":122,"props":3300,"children":3301},{"style":135},[3302],{"type":45,"value":138},{"type":39,"tag":122,"props":3304,"children":3305},{"style":141},[3306],{"type":45,"value":786},{"type":39,"tag":122,"props":3308,"children":3309},{"style":135},[3310],{"type":45,"value":791},{"type":39,"tag":122,"props":3312,"children":3313},{"style":141},[3314],{"type":45,"value":796},{"type":39,"tag":122,"props":3316,"children":3317},{"style":135},[3318],{"type":45,"value":149},{"type":39,"tag":122,"props":3320,"children":3321},{"style":135},[3322],{"type":45,"value":627},{"type":39,"tag":122,"props":3324,"children":3325},{"style":129},[3326],{"type":45,"value":809},{"type":39,"tag":122,"props":3328,"children":3329},{"style":141},[3330],{"type":45,"value":814},{"type":39,"tag":122,"props":3332,"children":3333},{"style":135},[3334],{"type":45,"value":608},{"type":39,"tag":122,"props":3336,"children":3337},{"style":141},[3338],{"type":45,"value":3339},"signIn",{"type":39,"tag":122,"props":3341,"children":3342},{"style":135},[3343],{"type":45,"value":608},{"type":39,"tag":122,"props":3345,"children":3346},{"style":254},[3347],{"type":45,"value":1757},{"type":39,"tag":122,"props":3349,"children":3350},{"style":273},[3351],{"type":45,"value":3352},"(\n",{"type":39,"tag":122,"props":3354,"children":3355},{"class":124,"line":219},[3356,3361,3366,3370,3374],{"type":39,"tag":122,"props":3357,"children":3358},{"style":135},[3359],{"type":45,"value":3360},"    {",{"type":39,"tag":122,"props":3362,"children":3363},{"style":141},[3364],{"type":45,"value":3365}," email",{"type":39,"tag":122,"props":3367,"children":3368},{"style":135},[3369],{"type":45,"value":791},{"type":39,"tag":122,"props":3371,"children":3372},{"style":141},[3373],{"type":45,"value":3271},{"type":39,"tag":122,"props":3375,"children":3376},{"style":135},[3377],{"type":45,"value":3378}," },\n",{"type":39,"tag":122,"props":3380,"children":3381},{"class":124,"line":229},[3382],{"type":39,"tag":122,"props":3383,"children":3384},{"style":135},[3385],{"type":45,"value":3386},"    {\n",{"type":39,"tag":122,"props":3388,"children":3389},{"class":124,"line":269},[3390,3395,3399,3404,3408],{"type":39,"tag":122,"props":3391,"children":3392},{"style":273},[3393],{"type":45,"value":3394},"      onSuccess",{"type":39,"tag":122,"props":3396,"children":3397},{"style":135},[3398],{"type":45,"value":261},{"type":39,"tag":122,"props":3400,"children":3401},{"style":743},[3402],{"type":45,"value":3403},"context",{"type":39,"tag":122,"props":3405,"children":3406},{"style":135},[3407],{"type":45,"value":377},{"type":39,"tag":122,"props":3409,"children":3410},{"style":135},[3411],{"type":45,"value":595},{"type":39,"tag":122,"props":3413,"children":3414},{"class":124,"line":302},[3415,3420,3424,3428,3432,3436,3440,3445,3449],{"type":39,"tag":122,"props":3416,"children":3417},{"style":129},[3418],{"type":45,"value":3419},"        if",{"type":39,"tag":122,"props":3421,"children":3422},{"style":273},[3423],{"type":45,"value":740},{"type":39,"tag":122,"props":3425,"children":3426},{"style":141},[3427],{"type":45,"value":3403},{"type":39,"tag":122,"props":3429,"children":3430},{"style":135},[3431],{"type":45,"value":608},{"type":39,"tag":122,"props":3433,"children":3434},{"style":141},[3435],{"type":45,"value":892},{"type":39,"tag":122,"props":3437,"children":3438},{"style":135},[3439],{"type":45,"value":608},{"type":39,"tag":122,"props":3441,"children":3442},{"style":141},[3443],{"type":45,"value":3444},"twoFactorRedirect",{"type":39,"tag":122,"props":3446,"children":3447},{"style":273},[3448],{"type":45,"value":897},{"type":39,"tag":122,"props":3450,"children":3451},{"style":135},[3452],{"type":45,"value":266},{"type":39,"tag":122,"props":3454,"children":3455},{"class":124,"line":320},[3456,3461,3465,3469,3473,3477,3481,3485,3489,3493],{"type":39,"tag":122,"props":3457,"children":3458},{"style":141},[3459],{"type":45,"value":3460},"          window",{"type":39,"tag":122,"props":3462,"children":3463},{"style":135},[3464],{"type":45,"value":608},{"type":39,"tag":122,"props":3466,"children":3467},{"style":141},[3468],{"type":45,"value":613},{"type":39,"tag":122,"props":3470,"children":3471},{"style":135},[3472],{"type":45,"value":608},{"type":39,"tag":122,"props":3474,"children":3475},{"style":141},[3476],{"type":45,"value":622},{"type":39,"tag":122,"props":3478,"children":3479},{"style":135},[3480],{"type":45,"value":627},{"type":39,"tag":122,"props":3482,"children":3483},{"style":135},[3484],{"type":45,"value":159},{"type":39,"tag":122,"props":3486,"children":3487},{"style":162},[3488],{"type":45,"value":636},{"type":39,"tag":122,"props":3490,"children":3491},{"style":135},[3492],{"type":45,"value":169},{"type":39,"tag":122,"props":3494,"children":3495},{"style":135},[3496],{"type":45,"value":174},{"type":39,"tag":122,"props":3498,"children":3499},{"class":124,"line":337},[3500],{"type":39,"tag":122,"props":3501,"children":3502},{"style":135},[3503],{"type":45,"value":3504},"        }\n",{"type":39,"tag":122,"props":3506,"children":3507},{"class":124,"line":366},[3508],{"type":39,"tag":122,"props":3509,"children":3510},{"style":135},[3511],{"type":45,"value":652},{"type":39,"tag":122,"props":3513,"children":3514},{"class":124,"line":384},[3515],{"type":39,"tag":122,"props":3516,"children":3517},{"style":135},[3518],{"type":45,"value":3519},"    }\n",{"type":39,"tag":122,"props":3521,"children":3522},{"class":124,"line":397},[3523,3527],{"type":39,"tag":122,"props":3524,"children":3525},{"style":273},[3526],{"type":45,"value":2623},{"type":39,"tag":122,"props":3528,"children":3529},{"style":135},[3530],{"type":45,"value":174},{"type":39,"tag":122,"props":3532,"children":3533},{"class":124,"line":681},[3534],{"type":39,"tag":122,"props":3535,"children":3536},{"style":135},[3537],{"type":45,"value":934},{"type":39,"tag":702,"props":3539,"children":3540},{},[3541,3543,3549,3551,3557],{"type":45,"value":3542},"Server-side: check ",{"type":39,"tag":58,"props":3544,"children":3546},{"className":3545},[],[3547],{"type":45,"value":3548},"\"twoFactorRedirect\" in response",{"type":45,"value":3550}," when using ",{"type":39,"tag":58,"props":3552,"children":3554},{"className":3553},[],[3555],{"type":45,"value":3556},"auth.api.signInEmail",{"type":45,"value":608},{"type":39,"tag":40,"props":3559,"children":3561},{"id":3560},"trusted-devices",[3562],{"type":45,"value":3563},"Trusted Devices",{"type":39,"tag":702,"props":3565,"children":3566},{},[3567,3569,3575,3577,3583],{"type":45,"value":3568},"Pass ",{"type":39,"tag":58,"props":3570,"children":3572},{"className":3571},[],[3573],{"type":45,"value":3574},"trustDevice: true",{"type":45,"value":3576}," when verifying. Default trust duration: 30 days (",{"type":39,"tag":58,"props":3578,"children":3580},{"className":3579},[],[3581],{"type":45,"value":3582},"trustDeviceMaxAge",{"type":45,"value":3584},"). Refreshes on each sign-in.",{"type":39,"tag":40,"props":3586,"children":3588},{"id":3587},"security-considerations",[3589],{"type":45,"value":3590},"Security Considerations",{"type":39,"tag":413,"props":3592,"children":3594},{"id":3593},"session-management",[3595],{"type":45,"value":3596},"Session Management",{"type":39,"tag":702,"props":3598,"children":3599},{},[3600],{"type":45,"value":3601},"Flow: credentials → session removed → temporary 2FA cookie (10 min default) → verify → session created.",{"type":39,"tag":111,"props":3603,"children":3605},{"className":113,"code":3604,"language":115,"meta":116,"style":116},"twoFactor({\n  twoFactorCookieMaxAge: 600, \u002F\u002F 10 minutes in seconds (default)\n});\n",[3606],{"type":39,"tag":58,"props":3607,"children":3608},{"__ignoreMap":116},[3609,3624,3650],{"type":39,"tag":122,"props":3610,"children":3611},{"class":124,"line":125},[3612,3616,3620],{"type":39,"tag":122,"props":3613,"children":3614},{"style":254},[3615],{"type":45,"value":823},{"type":39,"tag":122,"props":3617,"children":3618},{"style":141},[3619],{"type":45,"value":261},{"type":39,"tag":122,"props":3621,"children":3622},{"style":135},[3623],{"type":45,"value":266},{"type":39,"tag":122,"props":3625,"children":3626},{"class":124,"line":177},[3627,3632,3636,3641,3645],{"type":39,"tag":122,"props":3628,"children":3629},{"style":273},[3630],{"type":45,"value":3631},"  twoFactorCookieMaxAge",{"type":39,"tag":122,"props":3633,"children":3634},{"style":135},[3635],{"type":45,"value":281},{"type":39,"tag":122,"props":3637,"children":3638},{"style":1373},[3639],{"type":45,"value":3640}," 600",{"type":39,"tag":122,"props":3642,"children":3643},{"style":135},[3644],{"type":45,"value":791},{"type":39,"tag":122,"props":3646,"children":3647},{"style":907},[3648],{"type":45,"value":3649}," \u002F\u002F 10 minutes in seconds (default)\n",{"type":39,"tag":122,"props":3651,"children":3652},{"class":124,"line":219},[3653,3657,3661],{"type":39,"tag":122,"props":3654,"children":3655},{"style":135},[3656],{"type":45,"value":403},{"type":39,"tag":122,"props":3658,"children":3659},{"style":141},[3660],{"type":45,"value":377},{"type":39,"tag":122,"props":3662,"children":3663},{"style":135},[3664],{"type":45,"value":174},{"type":39,"tag":413,"props":3666,"children":3668},{"id":3667},"rate-limiting",[3669],{"type":45,"value":3670},"Rate Limiting",{"type":39,"tag":702,"props":3672,"children":3673},{},[3674],{"type":45,"value":3675},"Built-in: 3 requests per 10 seconds for all 2FA endpoints. OTP has additional attempt limiting:",{"type":39,"tag":111,"props":3677,"children":3679},{"className":113,"code":3678,"language":115,"meta":116,"style":116},"twoFactor({\n  otpOptions: {\n    allowedAttempts: 5, \u002F\u002F Max attempts per OTP code (default: 5)\n  },\n});\n",[3680],{"type":39,"tag":58,"props":3681,"children":3682},{"__ignoreMap":116},[3683,3698,3713,3738,3745],{"type":39,"tag":122,"props":3684,"children":3685},{"class":124,"line":125},[3686,3690,3694],{"type":39,"tag":122,"props":3687,"children":3688},{"style":254},[3689],{"type":45,"value":823},{"type":39,"tag":122,"props":3691,"children":3692},{"style":141},[3693],{"type":45,"value":261},{"type":39,"tag":122,"props":3695,"children":3696},{"style":135},[3697],{"type":45,"value":266},{"type":39,"tag":122,"props":3699,"children":3700},{"class":124,"line":177},[3701,3705,3709],{"type":39,"tag":122,"props":3702,"children":3703},{"style":273},[3704],{"type":45,"value":2056},{"type":39,"tag":122,"props":3706,"children":3707},{"style":135},[3708],{"type":45,"value":281},{"type":39,"tag":122,"props":3710,"children":3711},{"style":135},[3712],{"type":45,"value":595},{"type":39,"tag":122,"props":3714,"children":3715},{"class":124,"line":219},[3716,3721,3725,3729,3733],{"type":39,"tag":122,"props":3717,"children":3718},{"style":273},[3719],{"type":45,"value":3720},"    allowedAttempts",{"type":39,"tag":122,"props":3722,"children":3723},{"style":135},[3724],{"type":45,"value":281},{"type":39,"tag":122,"props":3726,"children":3727},{"style":1373},[3728],{"type":45,"value":1876},{"type":39,"tag":122,"props":3730,"children":3731},{"style":135},[3732],{"type":45,"value":791},{"type":39,"tag":122,"props":3734,"children":3735},{"style":907},[3736],{"type":45,"value":3737}," \u002F\u002F Max attempts per OTP code (default: 5)\n",{"type":39,"tag":122,"props":3739,"children":3740},{"class":124,"line":229},[3741],{"type":39,"tag":122,"props":3742,"children":3743},{"style":135},[3744],{"type":45,"value":1419},{"type":39,"tag":122,"props":3746,"children":3747},{"class":124,"line":269},[3748,3752,3756],{"type":39,"tag":122,"props":3749,"children":3750},{"style":135},[3751],{"type":45,"value":403},{"type":39,"tag":122,"props":3753,"children":3754},{"style":141},[3755],{"type":45,"value":377},{"type":39,"tag":122,"props":3757,"children":3758},{"style":135},[3759],{"type":45,"value":174},{"type":39,"tag":413,"props":3761,"children":3763},{"id":3762},"encryption-at-rest",[3764],{"type":45,"value":3765},"Encryption at Rest",{"type":39,"tag":702,"props":3767,"children":3768},{},[3769,3771,3777,3779,3785,3786,3792],{"type":45,"value":3770},"TOTP secrets: encrypted with auth secret. Backup codes: encrypted by default. OTP: configurable (",{"type":39,"tag":58,"props":3772,"children":3774},{"className":3773},[],[3775],{"type":45,"value":3776},"\"plain\"",{"type":45,"value":3778},", ",{"type":39,"tag":58,"props":3780,"children":3782},{"className":3781},[],[3783],{"type":45,"value":3784},"\"encrypted\"",{"type":45,"value":3778},{"type":39,"tag":58,"props":3787,"children":3789},{"className":3788},[],[3790],{"type":45,"value":3791},"\"hashed\"",{"type":45,"value":3793},"). Uses constant-time comparison for verification.",{"type":39,"tag":702,"props":3795,"children":3796},{},[3797],{"type":45,"value":3798},"2FA can only be enabled for credential (email\u002Fpassword) accounts.",{"type":39,"tag":40,"props":3800,"children":3802},{"id":3801},"disabling-2fa",[3803],{"type":45,"value":3804},"Disabling 2FA",{"type":39,"tag":702,"props":3806,"children":3807},{},[3808],{"type":45,"value":3809},"Requires password confirmation. Revokes trusted device records:",{"type":39,"tag":111,"props":3811,"children":3813},{"className":113,"code":3812,"language":115,"meta":116,"style":116},"const disable2FA = async (password: string) => {\n  const { data, error } = await authClient.twoFactor.disable({\n    password,\n  });\n};\n",[3814],{"type":39,"tag":58,"props":3815,"children":3816},{"__ignoreMap":116},[3817,3865,3929,3940,3955],{"type":39,"tag":122,"props":3818,"children":3819},{"class":124,"line":125},[3820,3824,3829,3833,3837,3841,3845,3849,3853,3857,3861],{"type":39,"tag":122,"props":3821,"children":3822},{"style":238},[3823],{"type":45,"value":721},{"type":39,"tag":122,"props":3825,"children":3826},{"style":141},[3827],{"type":45,"value":3828}," disable2FA ",{"type":39,"tag":122,"props":3830,"children":3831},{"style":135},[3832],{"type":45,"value":251},{"type":39,"tag":122,"props":3834,"children":3835},{"style":238},[3836],{"type":45,"value":735},{"type":39,"tag":122,"props":3838,"children":3839},{"style":135},[3840],{"type":45,"value":740},{"type":39,"tag":122,"props":3842,"children":3843},{"style":743},[3844],{"type":45,"value":746},{"type":39,"tag":122,"props":3846,"children":3847},{"style":135},[3848],{"type":45,"value":281},{"type":39,"tag":122,"props":3850,"children":3851},{"style":753},[3852],{"type":45,"value":756},{"type":39,"tag":122,"props":3854,"children":3855},{"style":135},[3856],{"type":45,"value":377},{"type":39,"tag":122,"props":3858,"children":3859},{"style":238},[3860],{"type":45,"value":765},{"type":39,"tag":122,"props":3862,"children":3863},{"style":135},[3864],{"type":45,"value":595},{"type":39,"tag":122,"props":3866,"children":3867},{"class":124,"line":177},[3868,3872,3876,3880,3884,3888,3892,3896,3900,3904,3908,3912,3916,3921,3925],{"type":39,"tag":122,"props":3869,"children":3870},{"style":238},[3871],{"type":45,"value":777},{"type":39,"tag":122,"props":3873,"children":3874},{"style":135},[3875],{"type":45,"value":138},{"type":39,"tag":122,"props":3877,"children":3878},{"style":141},[3879],{"type":45,"value":786},{"type":39,"tag":122,"props":3881,"children":3882},{"style":135},[3883],{"type":45,"value":791},{"type":39,"tag":122,"props":3885,"children":3886},{"style":141},[3887],{"type":45,"value":796},{"type":39,"tag":122,"props":3889,"children":3890},{"style":135},[3891],{"type":45,"value":149},{"type":39,"tag":122,"props":3893,"children":3894},{"style":135},[3895],{"type":45,"value":627},{"type":39,"tag":122,"props":3897,"children":3898},{"style":129},[3899],{"type":45,"value":809},{"type":39,"tag":122,"props":3901,"children":3902},{"style":141},[3903],{"type":45,"value":814},{"type":39,"tag":122,"props":3905,"children":3906},{"style":135},[3907],{"type":45,"value":608},{"type":39,"tag":122,"props":3909,"children":3910},{"style":141},[3911],{"type":45,"value":823},{"type":39,"tag":122,"props":3913,"children":3914},{"style":135},[3915],{"type":45,"value":608},{"type":39,"tag":122,"props":3917,"children":3918},{"style":254},[3919],{"type":45,"value":3920},"disable",{"type":39,"tag":122,"props":3922,"children":3923},{"style":273},[3924],{"type":45,"value":261},{"type":39,"tag":122,"props":3926,"children":3927},{"style":135},[3928],{"type":45,"value":266},{"type":39,"tag":122,"props":3930,"children":3931},{"class":124,"line":219},[3932,3936],{"type":39,"tag":122,"props":3933,"children":3934},{"style":141},[3935],{"type":45,"value":848},{"type":39,"tag":122,"props":3937,"children":3938},{"style":135},[3939],{"type":45,"value":299},{"type":39,"tag":122,"props":3941,"children":3942},{"class":124,"line":229},[3943,3947,3951],{"type":39,"tag":122,"props":3944,"children":3945},{"style":135},[3946],{"type":45,"value":860},{"type":39,"tag":122,"props":3948,"children":3949},{"style":273},[3950],{"type":45,"value":377},{"type":39,"tag":122,"props":3952,"children":3953},{"style":135},[3954],{"type":45,"value":174},{"type":39,"tag":122,"props":3956,"children":3957},{"class":124,"line":269},[3958],{"type":39,"tag":122,"props":3959,"children":3960},{"style":135},[3961],{"type":45,"value":934},{"type":39,"tag":40,"props":3963,"children":3965},{"id":3964},"complete-configuration-example",[3966],{"type":45,"value":3967},"Complete Configuration Example",{"type":39,"tag":111,"props":3969,"children":3971},{"className":113,"code":3970,"language":115,"meta":116,"style":116},"import { betterAuth } from \"better-auth\";\nimport { twoFactor } from \"better-auth\u002Fplugins\";\nimport { sendEmail } from \".\u002Femail\";\n\nexport const auth = betterAuth({\n  appName: \"My App\",\n  plugins: [\n    twoFactor({\n      \u002F\u002F TOTP settings\n      issuer: \"My App\",\n      totpOptions: {\n        digits: 6,\n        period: 30,\n      },\n      \u002F\u002F OTP settings\n      otpOptions: {\n        sendOTP: async ({ user, otp }) => {\n          await sendEmail({\n            to: user.email,\n            subject: \"Your verification code\",\n            text: `Your code is: ${otp}`,\n          });\n        },\n        period: 5,\n        allowedAttempts: 5,\n        storeOTP: \"encrypted\",\n      },\n      \u002F\u002F Backup code settings\n      backupCodeOptions: {\n        amount: 10,\n        length: 10,\n        storeBackupCodes: \"encrypted\",\n      },\n      \u002F\u002F Session settings\n      twoFactorCookieMaxAge: 600, \u002F\u002F 10 minutes\n      trustDeviceMaxAge: 30 * 24 * 60 * 60, \u002F\u002F 30 days\n    }),\n  ],\n});\n",[3972],{"type":39,"tag":58,"props":3973,"children":3974},{"__ignoreMap":116},[3975,4014,4053,4092,4099,4130,4157,4172,4187,4195,4222,4238,4257,4276,4283,4291,4306,4349,4368,4395,4422,4457,4472,4480,4500,4520,4549,4557,4565,4582,4603,4624,4653,4661,4670,4696,4749,4765,4777],{"type":39,"tag":122,"props":3976,"children":3977},{"class":124,"line":125},[3978,3982,3986,3990,3994,3998,4002,4006,4010],{"type":39,"tag":122,"props":3979,"children":3980},{"style":129},[3981],{"type":45,"value":132},{"type":39,"tag":122,"props":3983,"children":3984},{"style":135},[3985],{"type":45,"value":138},{"type":39,"tag":122,"props":3987,"children":3988},{"style":141},[3989],{"type":45,"value":144},{"type":39,"tag":122,"props":3991,"children":3992},{"style":135},[3993],{"type":45,"value":149},{"type":39,"tag":122,"props":3995,"children":3996},{"style":129},[3997],{"type":45,"value":154},{"type":39,"tag":122,"props":3999,"children":4000},{"style":135},[4001],{"type":45,"value":159},{"type":39,"tag":122,"props":4003,"children":4004},{"style":162},[4005],{"type":45,"value":8},{"type":39,"tag":122,"props":4007,"children":4008},{"style":135},[4009],{"type":45,"value":169},{"type":39,"tag":122,"props":4011,"children":4012},{"style":135},[4013],{"type":45,"value":174},{"type":39,"tag":122,"props":4015,"children":4016},{"class":124,"line":177},[4017,4021,4025,4029,4033,4037,4041,4045,4049],{"type":39,"tag":122,"props":4018,"children":4019},{"style":129},[4020],{"type":45,"value":132},{"type":39,"tag":122,"props":4022,"children":4023},{"style":135},[4024],{"type":45,"value":138},{"type":39,"tag":122,"props":4026,"children":4027},{"style":141},[4028],{"type":45,"value":191},{"type":39,"tag":122,"props":4030,"children":4031},{"style":135},[4032],{"type":45,"value":149},{"type":39,"tag":122,"props":4034,"children":4035},{"style":129},[4036],{"type":45,"value":154},{"type":39,"tag":122,"props":4038,"children":4039},{"style":135},[4040],{"type":45,"value":159},{"type":39,"tag":122,"props":4042,"children":4043},{"style":162},[4044],{"type":45,"value":208},{"type":39,"tag":122,"props":4046,"children":4047},{"style":135},[4048],{"type":45,"value":169},{"type":39,"tag":122,"props":4050,"children":4051},{"style":135},[4052],{"type":45,"value":174},{"type":39,"tag":122,"props":4054,"children":4055},{"class":124,"line":219},[4056,4060,4064,4068,4072,4076,4080,4084,4088],{"type":39,"tag":122,"props":4057,"children":4058},{"style":129},[4059],{"type":45,"value":132},{"type":39,"tag":122,"props":4061,"children":4062},{"style":135},[4063],{"type":45,"value":138},{"type":39,"tag":122,"props":4065,"children":4066},{"style":141},[4067],{"type":45,"value":1547},{"type":39,"tag":122,"props":4069,"children":4070},{"style":135},[4071],{"type":45,"value":149},{"type":39,"tag":122,"props":4073,"children":4074},{"style":129},[4075],{"type":45,"value":154},{"type":39,"tag":122,"props":4077,"children":4078},{"style":135},[4079],{"type":45,"value":159},{"type":39,"tag":122,"props":4081,"children":4082},{"style":162},[4083],{"type":45,"value":1564},{"type":39,"tag":122,"props":4085,"children":4086},{"style":135},[4087],{"type":45,"value":169},{"type":39,"tag":122,"props":4089,"children":4090},{"style":135},[4091],{"type":45,"value":174},{"type":39,"tag":122,"props":4093,"children":4094},{"class":124,"line":229},[4095],{"type":39,"tag":122,"props":4096,"children":4097},{"emptyLinePlaceholder":223},[4098],{"type":45,"value":226},{"type":39,"tag":122,"props":4100,"children":4101},{"class":124,"line":269},[4102,4106,4110,4114,4118,4122,4126],{"type":39,"tag":122,"props":4103,"children":4104},{"style":129},[4105],{"type":45,"value":235},{"type":39,"tag":122,"props":4107,"children":4108},{"style":238},[4109],{"type":45,"value":241},{"type":39,"tag":122,"props":4111,"children":4112},{"style":141},[4113],{"type":45,"value":246},{"type":39,"tag":122,"props":4115,"children":4116},{"style":135},[4117],{"type":45,"value":251},{"type":39,"tag":122,"props":4119,"children":4120},{"style":254},[4121],{"type":45,"value":144},{"type":39,"tag":122,"props":4123,"children":4124},{"style":141},[4125],{"type":45,"value":261},{"type":39,"tag":122,"props":4127,"children":4128},{"style":135},[4129],{"type":45,"value":266},{"type":39,"tag":122,"props":4131,"children":4132},{"class":124,"line":302},[4133,4137,4141,4145,4149,4153],{"type":39,"tag":122,"props":4134,"children":4135},{"style":273},[4136],{"type":45,"value":276},{"type":39,"tag":122,"props":4138,"children":4139},{"style":135},[4140],{"type":45,"value":281},{"type":39,"tag":122,"props":4142,"children":4143},{"style":135},[4144],{"type":45,"value":159},{"type":39,"tag":122,"props":4146,"children":4147},{"style":162},[4148],{"type":45,"value":290},{"type":39,"tag":122,"props":4150,"children":4151},{"style":135},[4152],{"type":45,"value":169},{"type":39,"tag":122,"props":4154,"children":4155},{"style":135},[4156],{"type":45,"value":299},{"type":39,"tag":122,"props":4158,"children":4159},{"class":124,"line":320},[4160,4164,4168],{"type":39,"tag":122,"props":4161,"children":4162},{"style":273},[4163],{"type":45,"value":308},{"type":39,"tag":122,"props":4165,"children":4166},{"style":135},[4167],{"type":45,"value":281},{"type":39,"tag":122,"props":4169,"children":4170},{"style":141},[4171],{"type":45,"value":317},{"type":39,"tag":122,"props":4173,"children":4174},{"class":124,"line":337},[4175,4179,4183],{"type":39,"tag":122,"props":4176,"children":4177},{"style":254},[4178],{"type":45,"value":326},{"type":39,"tag":122,"props":4180,"children":4181},{"style":141},[4182],{"type":45,"value":261},{"type":39,"tag":122,"props":4184,"children":4185},{"style":135},[4186],{"type":45,"value":266},{"type":39,"tag":122,"props":4188,"children":4189},{"class":124,"line":366},[4190],{"type":39,"tag":122,"props":4191,"children":4192},{"style":907},[4193],{"type":45,"value":4194},"      \u002F\u002F TOTP settings\n",{"type":39,"tag":122,"props":4196,"children":4197},{"class":124,"line":384},[4198,4202,4206,4210,4214,4218],{"type":39,"tag":122,"props":4199,"children":4200},{"style":273},[4201],{"type":45,"value":343},{"type":39,"tag":122,"props":4203,"children":4204},{"style":135},[4205],{"type":45,"value":281},{"type":39,"tag":122,"props":4207,"children":4208},{"style":135},[4209],{"type":45,"value":159},{"type":39,"tag":122,"props":4211,"children":4212},{"style":162},[4213],{"type":45,"value":290},{"type":39,"tag":122,"props":4215,"children":4216},{"style":135},[4217],{"type":45,"value":169},{"type":39,"tag":122,"props":4219,"children":4220},{"style":135},[4221],{"type":45,"value":299},{"type":39,"tag":122,"props":4223,"children":4224},{"class":124,"line":397},[4225,4230,4234],{"type":39,"tag":122,"props":4226,"children":4227},{"style":273},[4228],{"type":45,"value":4229},"      totpOptions",{"type":39,"tag":122,"props":4231,"children":4232},{"style":135},[4233],{"type":45,"value":281},{"type":39,"tag":122,"props":4235,"children":4236},{"style":135},[4237],{"type":45,"value":595},{"type":39,"tag":122,"props":4239,"children":4240},{"class":124,"line":681},[4241,4245,4249,4253],{"type":39,"tag":122,"props":4242,"children":4243},{"style":273},[4244],{"type":45,"value":1894},{"type":39,"tag":122,"props":4246,"children":4247},{"style":135},[4248],{"type":45,"value":281},{"type":39,"tag":122,"props":4250,"children":4251},{"style":1373},[4252],{"type":45,"value":1376},{"type":39,"tag":122,"props":4254,"children":4255},{"style":135},[4256],{"type":45,"value":299},{"type":39,"tag":122,"props":4258,"children":4259},{"class":124,"line":1793},[4260,4264,4268,4272],{"type":39,"tag":122,"props":4261,"children":4262},{"style":273},[4263],{"type":45,"value":1867},{"type":39,"tag":122,"props":4265,"children":4266},{"style":135},[4267],{"type":45,"value":281},{"type":39,"tag":122,"props":4269,"children":4270},{"style":1373},[4271],{"type":45,"value":1402},{"type":39,"tag":122,"props":4273,"children":4274},{"style":135},[4275],{"type":45,"value":299},{"type":39,"tag":122,"props":4277,"children":4278},{"class":124,"line":1835},[4279],{"type":39,"tag":122,"props":4280,"children":4281},{"style":135},[4282],{"type":45,"value":652},{"type":39,"tag":122,"props":4284,"children":4285},{"class":124,"line":1852},[4286],{"type":39,"tag":122,"props":4287,"children":4288},{"style":907},[4289],{"type":45,"value":4290},"      \u002F\u002F OTP settings\n",{"type":39,"tag":122,"props":4292,"children":4293},{"class":124,"line":1861},[4294,4298,4302],{"type":39,"tag":122,"props":4295,"children":4296},{"style":273},[4297],{"type":45,"value":1648},{"type":39,"tag":122,"props":4299,"children":4300},{"style":135},[4301],{"type":45,"value":281},{"type":39,"tag":122,"props":4303,"children":4304},{"style":135},[4305],{"type":45,"value":595},{"type":39,"tag":122,"props":4307,"children":4308},{"class":124,"line":1888},[4309,4313,4317,4321,4325,4329,4333,4337,4341,4345],{"type":39,"tag":122,"props":4310,"children":4311},{"style":254},[4312],{"type":45,"value":1664},{"type":39,"tag":122,"props":4314,"children":4315},{"style":135},[4316],{"type":45,"value":281},{"type":39,"tag":122,"props":4318,"children":4319},{"style":238},[4320],{"type":45,"value":735},{"type":39,"tag":122,"props":4322,"children":4323},{"style":135},[4324],{"type":45,"value":1044},{"type":39,"tag":122,"props":4326,"children":4327},{"style":743},[4328],{"type":45,"value":1681},{"type":39,"tag":122,"props":4330,"children":4331},{"style":135},[4332],{"type":45,"value":791},{"type":39,"tag":122,"props":4334,"children":4335},{"style":743},[4336],{"type":45,"value":1690},{"type":39,"tag":122,"props":4338,"children":4339},{"style":135},[4340],{"type":45,"value":1075},{"type":39,"tag":122,"props":4342,"children":4343},{"style":238},[4344],{"type":45,"value":765},{"type":39,"tag":122,"props":4346,"children":4347},{"style":135},[4348],{"type":45,"value":595},{"type":39,"tag":122,"props":4350,"children":4351},{"class":124,"line":1914},[4352,4356,4360,4364],{"type":39,"tag":122,"props":4353,"children":4354},{"style":129},[4355],{"type":45,"value":1720},{"type":39,"tag":122,"props":4357,"children":4358},{"style":254},[4359],{"type":45,"value":1547},{"type":39,"tag":122,"props":4361,"children":4362},{"style":273},[4363],{"type":45,"value":261},{"type":39,"tag":122,"props":4365,"children":4366},{"style":135},[4367],{"type":45,"value":266},{"type":39,"tag":122,"props":4369,"children":4370},{"class":124,"line":1940},[4371,4375,4379,4383,4387,4391],{"type":39,"tag":122,"props":4372,"children":4373},{"style":273},[4374],{"type":45,"value":1740},{"type":39,"tag":122,"props":4376,"children":4377},{"style":135},[4378],{"type":45,"value":281},{"type":39,"tag":122,"props":4380,"children":4381},{"style":141},[4382],{"type":45,"value":1681},{"type":39,"tag":122,"props":4384,"children":4385},{"style":135},[4386],{"type":45,"value":608},{"type":39,"tag":122,"props":4388,"children":4389},{"style":141},[4390],{"type":45,"value":1757},{"type":39,"tag":122,"props":4392,"children":4393},{"style":135},[4394],{"type":45,"value":299},{"type":39,"tag":122,"props":4396,"children":4397},{"class":124,"line":1948},[4398,4402,4406,4410,4414,4418],{"type":39,"tag":122,"props":4399,"children":4400},{"style":273},[4401],{"type":45,"value":1769},{"type":39,"tag":122,"props":4403,"children":4404},{"style":135},[4405],{"type":45,"value":281},{"type":39,"tag":122,"props":4407,"children":4408},{"style":135},[4409],{"type":45,"value":159},{"type":39,"tag":122,"props":4411,"children":4412},{"style":162},[4413],{"type":45,"value":1782},{"type":39,"tag":122,"props":4415,"children":4416},{"style":135},[4417],{"type":45,"value":169},{"type":39,"tag":122,"props":4419,"children":4420},{"style":135},[4421],{"type":45,"value":299},{"type":39,"tag":122,"props":4423,"children":4424},{"class":124,"line":1964},[4425,4429,4433,4437,4441,4445,4449,4453],{"type":39,"tag":122,"props":4426,"children":4427},{"style":273},[4428],{"type":45,"value":1799},{"type":39,"tag":122,"props":4430,"children":4431},{"style":135},[4432],{"type":45,"value":281},{"type":39,"tag":122,"props":4434,"children":4435},{"style":135},[4436],{"type":45,"value":1808},{"type":39,"tag":122,"props":4438,"children":4439},{"style":162},[4440],{"type":45,"value":1813},{"type":39,"tag":122,"props":4442,"children":4443},{"style":135},[4444],{"type":45,"value":1818},{"type":39,"tag":122,"props":4446,"children":4447},{"style":141},[4448],{"type":45,"value":1823},{"type":39,"tag":122,"props":4450,"children":4451},{"style":135},[4452],{"type":45,"value":1828},{"type":39,"tag":122,"props":4454,"children":4455},{"style":135},[4456],{"type":45,"value":299},{"type":39,"tag":122,"props":4458,"children":4459},{"class":124,"line":1976},[4460,4464,4468],{"type":39,"tag":122,"props":4461,"children":4462},{"style":135},[4463],{"type":45,"value":1841},{"type":39,"tag":122,"props":4465,"children":4466},{"style":273},[4467],{"type":45,"value":377},{"type":39,"tag":122,"props":4469,"children":4470},{"style":135},[4471],{"type":45,"value":174},{"type":39,"tag":122,"props":4473,"children":4475},{"class":124,"line":4474},23,[4476],{"type":39,"tag":122,"props":4477,"children":4478},{"style":135},[4479],{"type":45,"value":1858},{"type":39,"tag":122,"props":4481,"children":4483},{"class":124,"line":4482},24,[4484,4488,4492,4496],{"type":39,"tag":122,"props":4485,"children":4486},{"style":273},[4487],{"type":45,"value":1867},{"type":39,"tag":122,"props":4489,"children":4490},{"style":135},[4491],{"type":45,"value":281},{"type":39,"tag":122,"props":4493,"children":4494},{"style":1373},[4495],{"type":45,"value":1876},{"type":39,"tag":122,"props":4497,"children":4498},{"style":135},[4499],{"type":45,"value":299},{"type":39,"tag":122,"props":4501,"children":4503},{"class":124,"line":4502},25,[4504,4508,4512,4516],{"type":39,"tag":122,"props":4505,"children":4506},{"style":273},[4507],{"type":45,"value":1920},{"type":39,"tag":122,"props":4509,"children":4510},{"style":135},[4511],{"type":45,"value":281},{"type":39,"tag":122,"props":4513,"children":4514},{"style":1373},[4515],{"type":45,"value":1876},{"type":39,"tag":122,"props":4517,"children":4518},{"style":135},[4519],{"type":45,"value":299},{"type":39,"tag":122,"props":4521,"children":4523},{"class":124,"line":4522},26,[4524,4529,4533,4537,4541,4545],{"type":39,"tag":122,"props":4525,"children":4526},{"style":273},[4527],{"type":45,"value":4528},"        storeOTP",{"type":39,"tag":122,"props":4530,"children":4531},{"style":135},[4532],{"type":45,"value":281},{"type":39,"tag":122,"props":4534,"children":4535},{"style":135},[4536],{"type":45,"value":159},{"type":39,"tag":122,"props":4538,"children":4539},{"style":162},[4540],{"type":45,"value":2085},{"type":39,"tag":122,"props":4542,"children":4543},{"style":135},[4544],{"type":45,"value":169},{"type":39,"tag":122,"props":4546,"children":4547},{"style":135},[4548],{"type":45,"value":299},{"type":39,"tag":122,"props":4550,"children":4552},{"class":124,"line":4551},27,[4553],{"type":39,"tag":122,"props":4554,"children":4555},{"style":135},[4556],{"type":45,"value":652},{"type":39,"tag":122,"props":4558,"children":4559},{"class":124,"line":27},[4560],{"type":39,"tag":122,"props":4561,"children":4562},{"style":907},[4563],{"type":45,"value":4564},"      \u002F\u002F Backup code settings\n",{"type":39,"tag":122,"props":4566,"children":4568},{"class":124,"line":4567},29,[4569,4574,4578],{"type":39,"tag":122,"props":4570,"children":4571},{"style":273},[4572],{"type":45,"value":4573},"      backupCodeOptions",{"type":39,"tag":122,"props":4575,"children":4576},{"style":135},[4577],{"type":45,"value":281},{"type":39,"tag":122,"props":4579,"children":4580},{"style":135},[4581],{"type":45,"value":595},{"type":39,"tag":122,"props":4583,"children":4585},{"class":124,"line":4584},30,[4586,4591,4595,4599],{"type":39,"tag":122,"props":4587,"children":4588},{"style":273},[4589],{"type":45,"value":4590},"        amount",{"type":39,"tag":122,"props":4592,"children":4593},{"style":135},[4594],{"type":45,"value":281},{"type":39,"tag":122,"props":4596,"children":4597},{"style":1373},[4598],{"type":45,"value":3043},{"type":39,"tag":122,"props":4600,"children":4601},{"style":135},[4602],{"type":45,"value":299},{"type":39,"tag":122,"props":4604,"children":4606},{"class":124,"line":4605},31,[4607,4612,4616,4620],{"type":39,"tag":122,"props":4608,"children":4609},{"style":273},[4610],{"type":45,"value":4611},"        length",{"type":39,"tag":122,"props":4613,"children":4614},{"style":135},[4615],{"type":45,"value":281},{"type":39,"tag":122,"props":4617,"children":4618},{"style":1373},[4619],{"type":45,"value":3043},{"type":39,"tag":122,"props":4621,"children":4622},{"style":135},[4623],{"type":45,"value":299},{"type":39,"tag":122,"props":4625,"children":4627},{"class":124,"line":4626},32,[4628,4633,4637,4641,4645,4649],{"type":39,"tag":122,"props":4629,"children":4630},{"style":273},[4631],{"type":45,"value":4632},"        storeBackupCodes",{"type":39,"tag":122,"props":4634,"children":4635},{"style":135},[4636],{"type":45,"value":281},{"type":39,"tag":122,"props":4638,"children":4639},{"style":135},[4640],{"type":45,"value":159},{"type":39,"tag":122,"props":4642,"children":4643},{"style":162},[4644],{"type":45,"value":2085},{"type":39,"tag":122,"props":4646,"children":4647},{"style":135},[4648],{"type":45,"value":169},{"type":39,"tag":122,"props":4650,"children":4651},{"style":135},[4652],{"type":45,"value":299},{"type":39,"tag":122,"props":4654,"children":4656},{"class":124,"line":4655},33,[4657],{"type":39,"tag":122,"props":4658,"children":4659},{"style":135},[4660],{"type":45,"value":652},{"type":39,"tag":122,"props":4662,"children":4664},{"class":124,"line":4663},34,[4665],{"type":39,"tag":122,"props":4666,"children":4667},{"style":907},[4668],{"type":45,"value":4669},"      \u002F\u002F Session settings\n",{"type":39,"tag":122,"props":4671,"children":4673},{"class":124,"line":4672},35,[4674,4679,4683,4687,4691],{"type":39,"tag":122,"props":4675,"children":4676},{"style":273},[4677],{"type":45,"value":4678},"      twoFactorCookieMaxAge",{"type":39,"tag":122,"props":4680,"children":4681},{"style":135},[4682],{"type":45,"value":281},{"type":39,"tag":122,"props":4684,"children":4685},{"style":1373},[4686],{"type":45,"value":3640},{"type":39,"tag":122,"props":4688,"children":4689},{"style":135},[4690],{"type":45,"value":791},{"type":39,"tag":122,"props":4692,"children":4693},{"style":907},[4694],{"type":45,"value":4695}," \u002F\u002F 10 minutes\n",{"type":39,"tag":122,"props":4697,"children":4699},{"class":124,"line":4698},36,[4700,4705,4709,4713,4718,4723,4727,4732,4736,4740,4744],{"type":39,"tag":122,"props":4701,"children":4702},{"style":273},[4703],{"type":45,"value":4704},"      trustDeviceMaxAge",{"type":39,"tag":122,"props":4706,"children":4707},{"style":135},[4708],{"type":45,"value":281},{"type":39,"tag":122,"props":4710,"children":4711},{"style":1373},[4712],{"type":45,"value":1402},{"type":39,"tag":122,"props":4714,"children":4715},{"style":135},[4716],{"type":45,"value":4717}," *",{"type":39,"tag":122,"props":4719,"children":4720},{"style":1373},[4721],{"type":45,"value":4722}," 24",{"type":39,"tag":122,"props":4724,"children":4725},{"style":135},[4726],{"type":45,"value":4717},{"type":39,"tag":122,"props":4728,"children":4729},{"style":1373},[4730],{"type":45,"value":4731}," 60",{"type":39,"tag":122,"props":4733,"children":4734},{"style":135},[4735],{"type":45,"value":4717},{"type":39,"tag":122,"props":4737,"children":4738},{"style":1373},[4739],{"type":45,"value":4731},{"type":39,"tag":122,"props":4741,"children":4742},{"style":135},[4743],{"type":45,"value":791},{"type":39,"tag":122,"props":4745,"children":4746},{"style":907},[4747],{"type":45,"value":4748}," \u002F\u002F 30 days\n",{"type":39,"tag":122,"props":4750,"children":4752},{"class":124,"line":4751},37,[4753,4757,4761],{"type":39,"tag":122,"props":4754,"children":4755},{"style":135},[4756],{"type":45,"value":372},{"type":39,"tag":122,"props":4758,"children":4759},{"style":141},[4760],{"type":45,"value":377},{"type":39,"tag":122,"props":4762,"children":4763},{"style":135},[4764],{"type":45,"value":299},{"type":39,"tag":122,"props":4766,"children":4768},{"class":124,"line":4767},38,[4769,4773],{"type":39,"tag":122,"props":4770,"children":4771},{"style":141},[4772],{"type":45,"value":390},{"type":39,"tag":122,"props":4774,"children":4775},{"style":135},[4776],{"type":45,"value":299},{"type":39,"tag":122,"props":4778,"children":4780},{"class":124,"line":4779},39,[4781,4785,4789],{"type":39,"tag":122,"props":4782,"children":4783},{"style":135},[4784],{"type":45,"value":403},{"type":39,"tag":122,"props":4786,"children":4787},{"style":141},[4788],{"type":45,"value":377},{"type":39,"tag":122,"props":4790,"children":4791},{"style":135},[4792],{"type":45,"value":174},{"type":39,"tag":4794,"props":4795,"children":4796},"style",{},[4797],{"type":45,"value":4798},"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);}",{"items":4800,"total":302},[4801,4816,4831,4844,4855,4870],{"slug":4802,"name":4802,"fn":4803,"description":4804,"org":4805,"tags":4806,"stars":23,"repoUrl":24,"updatedAt":4815},"better-auth-best-practices","configure Better Auth servers and clients","Configure Better Auth server and client, set up database adapters, manage sessions, add plugins, and handle environment variables. Use when users mention Better Auth, betterauth, auth.ts, or need to set up TypeScript authentication with email\u002Fpassword, OAuth, or plugin configuration.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4807,4808,4809,4812],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":4810,"slug":4811,"type":13},"Sessions","sessions",{"name":4813,"slug":4814,"type":13},"TypeScript","typescript","2026-04-06T18:05:01.910941",{"slug":4817,"name":4817,"fn":4818,"description":4819,"org":4820,"tags":4821,"stars":23,"repoUrl":24,"updatedAt":4830},"better-auth-security-best-practices","configure security best practices for Better Auth","Configure rate limiting, manage auth secrets, set up CSRF protection, define trusted origins, secure sessions and cookies, encrypt OAuth tokens, track IP addresses, and implement audit logging for Better Auth. Use when users need to secure their auth setup, prevent brute force attacks, or harden a Better Auth deployment.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4822,4825,4826,4827],{"name":4823,"slug":4824,"type":13},"Audit","audit",{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":4828,"slug":4829,"type":13},"Security","security","2026-07-11T05:40:04.318478",{"slug":4832,"name":4832,"fn":4833,"description":4834,"org":4835,"tags":4836,"stars":23,"repoUrl":24,"updatedAt":4843},"create-auth","scaffold Better Auth in TypeScript apps","Scaffold and implement authentication in TypeScript\u002FJavaScript apps using Better Auth. Detect frameworks, configure database adapters, set up route handlers, add OAuth providers, and create auth UI pages. Use when users want to add login, sign-up, or authentication to a new or existing project with Better Auth.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4837,4838,4839,4842],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":4840,"slug":4841,"type":13},"OAuth","oauth",{"name":4813,"slug":4814,"type":13},"2026-04-06T18:04:59.364175",{"slug":4845,"name":4845,"fn":4846,"description":4847,"org":4848,"tags":4849,"stars":23,"repoUrl":24,"updatedAt":4854},"email-and-password-best-practices","configure Better Auth email and password flows","Configure email verification, implement password reset flows, set password policies, and customise hashing algorithms for Better Auth email\u002Fpassword authentication. Use when users need to set up login, sign-in, sign-up, credential authentication, or password security with Better Auth.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4850,4851,4852],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":4853,"slug":1757,"type":13},"Email","2026-04-06T18:05:03.185369",{"slug":4856,"name":4856,"fn":4857,"description":4858,"org":4859,"tags":4860,"stars":23,"repoUrl":24,"updatedAt":4869},"organization-best-practices","set up multi-tenant orgs in Better Auth","Configure multi-tenant organizations, manage members and invitations, define custom roles and permissions, set up teams, and implement RBAC using Better Auth's organization plugin. Use when users need org setup, team management, member roles, access control, or the Better Auth organization plugin.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4861,4862,4863,4866],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":4864,"slug":4865,"type":13},"Multi-Tenant","multi-tenant",{"name":4867,"slug":4868,"type":13},"RBAC","rbac","2026-04-06T18:05:00.636075",{"slug":4,"name":4,"fn":5,"description":6,"org":4871,"tags":4872,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4873,4874,4875,4876],{"name":18,"slug":19,"type":13},{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":21,"slug":22,"type":13},{"items":4878,"total":302},[4879,4886,4893,4900,4906,4913],{"slug":4802,"name":4802,"fn":4803,"description":4804,"org":4880,"tags":4881,"stars":23,"repoUrl":24,"updatedAt":4815},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4882,4883,4884,4885],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":4810,"slug":4811,"type":13},{"name":4813,"slug":4814,"type":13},{"slug":4817,"name":4817,"fn":4818,"description":4819,"org":4887,"tags":4888,"stars":23,"repoUrl":24,"updatedAt":4830},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4889,4890,4891,4892],{"name":4823,"slug":4824,"type":13},{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":4828,"slug":4829,"type":13},{"slug":4832,"name":4832,"fn":4833,"description":4834,"org":4894,"tags":4895,"stars":23,"repoUrl":24,"updatedAt":4843},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4896,4897,4898,4899],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":4840,"slug":4841,"type":13},{"name":4813,"slug":4814,"type":13},{"slug":4845,"name":4845,"fn":4846,"description":4847,"org":4901,"tags":4902,"stars":23,"repoUrl":24,"updatedAt":4854},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4903,4904,4905],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":4853,"slug":1757,"type":13},{"slug":4856,"name":4856,"fn":4857,"description":4858,"org":4907,"tags":4908,"stars":23,"repoUrl":24,"updatedAt":4869},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4909,4910,4911,4912],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":4864,"slug":4865,"type":13},{"name":4867,"slug":4868,"type":13},{"slug":4,"name":4,"fn":5,"description":6,"org":4914,"tags":4915,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4916,4917,4918,4919],{"name":18,"slug":19,"type":13},{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":21,"slug":22,"type":13}]