[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-better-auth-email-and-password-best-practices":3,"mdc-axh6jf-key":30,"related-org-better-auth-email-and-password-best-practices":2979,"related-repo-better-auth-email-and-password-best-practices":3060},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":20,"repoUrl":21,"updatedAt":22,"license":23,"forks":24,"topics":25,"repo":26,"sourceUrl":28,"mdContent":29},"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},"better-auth","Better Auth","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fbetter-auth.png",[12,14,17],{"name":9,"slug":8,"type":13},"tag",{"name":15,"slug":16,"type":13},"Auth","auth",{"name":18,"slug":19,"type":13},"Email","email",201,"https:\u002F\u002Fgithub.com\u002Fbetter-auth\u002Fskills","2026-04-06T18:05:03.185369",null,28,[],{"repoUrl":21,"stars":20,"forks":24,"topics":27,"description":23},[],"https:\u002F\u002Fgithub.com\u002Fbetter-auth\u002Fskills\u002Ftree\u002FHEAD\u002Fbetter-auth\u002FemailAndPassword","---\nname: email-and-password-best-practices\ndescription: 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.\n---\n\n## Quick Start\n\n1. Enable email\u002Fpassword: `emailAndPassword: { enabled: true }`\n2. Configure `emailVerification.sendVerificationEmail`\n3. Add `sendResetPassword` for password reset flows\n4. Run `npx @better-auth\u002Fcli@latest migrate`\n5. Verify: attempt sign-up and confirm verification email triggers\n\n---\n\n## Email Verification Setup\n\nConfigure `emailVerification.sendVerificationEmail` to verify user email addresses.\n\n```ts\nimport { betterAuth } from \"better-auth\";\nimport { sendEmail } from \".\u002Femail\"; \u002F\u002F your email sending function\n\nexport const auth = betterAuth({\n  emailVerification: {\n    sendVerificationEmail: async ({ user, url, token }, request) => {\n      await sendEmail({\n        to: user.email,\n        subject: \"Verify your email address\",\n        text: `Click the link to verify your email: ${url}`,\n      });\n    },\n  },\n});\n```\n\n**Note**: The `url` parameter contains the full verification link. The `token` is available if you need to build a custom verification URL.\n\n### Requiring Email Verification\n\nFor stricter security, enable `emailAndPassword.requireEmailVerification` to block sign-in until the user verifies their email. When enabled, unverified users will receive a new verification email on each sign-in attempt.\n\n```ts\nexport const auth = betterAuth({\n  emailAndPassword: {\n    requireEmailVerification: true,\n  },\n});\n```\n\n**Note**: This requires `sendVerificationEmail` to be configured and only applies to email\u002Fpassword sign-ins.\n\n## Client Side Validation\n\nImplement client-side validation for immediate user feedback and reduced server load.\n\n## Callback URLs\n\nAlways use absolute URLs (including the origin) for callback URLs in sign-up and sign-in requests. This prevents Better Auth from needing to infer the origin, which can cause issues when your backend and frontend are on different domains.\n\n```ts\nconst { data, error } = await authClient.signUp.email({\n  callbackURL: \"https:\u002F\u002Fexample.com\u002Fcallback\", \u002F\u002F absolute URL with origin\n});\n```\n\n## Password Reset Flows\n\nProvide `sendResetPassword` in the email and password config to enable password resets.\n\n```ts\nimport { betterAuth } from \"better-auth\";\nimport { sendEmail } from \".\u002Femail\"; \u002F\u002F your email sending function\n\nexport const auth = betterAuth({\n  emailAndPassword: {\n    enabled: true,\n    \u002F\u002F Custom email sending function to send reset-password email\n    sendResetPassword: async ({ user, url, token }, request) => {\n      void sendEmail({\n        to: user.email,\n        subject: \"Reset your password\",\n        text: `Click the link to reset your password: ${url}`,\n      });\n    },\n    \u002F\u002F Optional event hook\n    onPasswordReset: async ({ user }, request) => {\n      \u002F\u002F your logic here\n      console.log(`Password for user ${user.email} has been reset.`);\n    },\n  },\n});\n```\n\n### Security Considerations\n\nBuilt-in protections: background email sending (timing attack prevention), dummy operations on invalid requests, constant response messages regardless of user existence.\n\nOn serverless platforms, configure a background task handler:\n\n```ts\nexport const auth = betterAuth({\n  advanced: {\n    backgroundTasks: {\n      handler: (promise) => {\n        \u002F\u002F Use platform-specific methods like waitUntil\n        waitUntil(promise);\n      },\n    },\n  },\n});\n```\n\n#### Token Security\n\nTokens expire after 1 hour by default. Configure with `resetPasswordTokenExpiresIn` (in seconds):\n\n```ts\nexport const auth = betterAuth({\n  emailAndPassword: {\n    enabled: true,\n    resetPasswordTokenExpiresIn: 60 * 30, \u002F\u002F 30 minutes\n  },\n});\n```\n\nTokens are single-use — deleted immediately after successful reset.\n\n#### Session Revocation\n\nEnable `revokeSessionsOnPasswordReset` to invalidate all existing sessions on password reset:\n\n```ts\nexport const auth = betterAuth({\n  emailAndPassword: {\n    enabled: true,\n    revokeSessionsOnPasswordReset: true,\n  },\n});\n```\n\n#### Password Requirements\n\nPassword length limits (configurable):\n\n```ts\nexport const auth = betterAuth({\n  emailAndPassword: {\n    enabled: true,\n    minPasswordLength: 12,\n    maxPasswordLength: 256,\n  },\n});\n```\n\n### Sending the Password Reset\n\nCall `requestPasswordReset` to send the reset link. Triggers the `sendResetPassword` function from your config.\n\n```ts\nconst data = await auth.api.requestPasswordReset({\n  body: {\n    email: \"john.doe@example.com\", \u002F\u002F required\n    redirectTo: \"https:\u002F\u002Fexample.com\u002Freset-password\",\n  },\n});\n```\n\nOr authClient:\n\n```ts\nconst { data, error } = await authClient.requestPasswordReset({\n  email: \"john.doe@example.com\", \u002F\u002F required\n  redirectTo: \"https:\u002F\u002Fexample.com\u002Freset-password\",\n});\n```\n\n**Note**: While the `email` is required, we also recommend configuring the `redirectTo` for a smoother user experience.\n\n## Password Hashing\n\nDefault: `scrypt` (Node.js native, no external dependencies).\n\n### Custom Hashing Algorithm\n\nTo use Argon2id or another algorithm, provide custom `hash` and `verify` functions:\n\n```ts\nimport { betterAuth } from \"better-auth\";\nimport { hash, verify, type Options } from \"@node-rs\u002Fargon2\";\n\nconst argon2Options: Options = {\n  memoryCost: 65536, \u002F\u002F 64 MiB\n  timeCost: 3, \u002F\u002F 3 iterations\n  parallelism: 4, \u002F\u002F 4 parallel lanes\n  outputLen: 32, \u002F\u002F 32 byte output\n  algorithm: 2, \u002F\u002F Argon2id variant\n};\n\nexport const auth = betterAuth({\n  emailAndPassword: {\n    enabled: true,\n    password: {\n      hash: (password) => hash(password, argon2Options),\n      verify: ({ password, hash: storedHash }) =>\n        verify(storedHash, password, argon2Options),\n    },\n  },\n});\n```\n\n**Note**: If you switch hashing algorithms on an existing system, users with passwords hashed using the old algorithm won't be able to sign in. Plan a migration strategy if needed.\n",{"data":31,"body":32},{"name":4,"description":6},{"type":33,"children":34},"root",[35,44,101,105,111,123,555,581,588,601,699,716,722,727,733,738,864,870,882,1410,1416,1421,1426,1599,1606,1619,1750,1755,1761,1774,1888,1894,1899,2035,2041,2061,2219,2224,2361,2385,2391,2404,2410,2431,2964,2973],{"type":36,"tag":37,"props":38,"children":40},"element","h2",{"id":39},"quick-start",[41],{"type":42,"value":43},"text","Quick Start",{"type":36,"tag":45,"props":46,"children":47},"ol",{},[48,61,72,85,96],{"type":36,"tag":49,"props":50,"children":51},"li",{},[52,54],{"type":42,"value":53},"Enable email\u002Fpassword: ",{"type":36,"tag":55,"props":56,"children":58},"code",{"className":57},[],[59],{"type":42,"value":60},"emailAndPassword: { enabled: true }",{"type":36,"tag":49,"props":62,"children":63},{},[64,66],{"type":42,"value":65},"Configure ",{"type":36,"tag":55,"props":67,"children":69},{"className":68},[],[70],{"type":42,"value":71},"emailVerification.sendVerificationEmail",{"type":36,"tag":49,"props":73,"children":74},{},[75,77,83],{"type":42,"value":76},"Add ",{"type":36,"tag":55,"props":78,"children":80},{"className":79},[],[81],{"type":42,"value":82},"sendResetPassword",{"type":42,"value":84}," for password reset flows",{"type":36,"tag":49,"props":86,"children":87},{},[88,90],{"type":42,"value":89},"Run ",{"type":36,"tag":55,"props":91,"children":93},{"className":92},[],[94],{"type":42,"value":95},"npx @better-auth\u002Fcli@latest migrate",{"type":36,"tag":49,"props":97,"children":98},{},[99],{"type":42,"value":100},"Verify: attempt sign-up and confirm verification email triggers",{"type":36,"tag":102,"props":103,"children":104},"hr",{},[],{"type":36,"tag":37,"props":106,"children":108},{"id":107},"email-verification-setup",[109],{"type":42,"value":110},"Email Verification Setup",{"type":36,"tag":112,"props":113,"children":114},"p",{},[115,116,121],{"type":42,"value":65},{"type":36,"tag":55,"props":117,"children":119},{"className":118},[],[120],{"type":42,"value":71},{"type":42,"value":122}," to verify user email addresses.",{"type":36,"tag":124,"props":125,"children":130},"pre",{"className":126,"code":127,"language":128,"meta":129,"style":129},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { betterAuth } from \"better-auth\";\nimport { sendEmail } from \".\u002Femail\"; \u002F\u002F your email sending function\n\nexport const auth = betterAuth({\n  emailVerification: {\n    sendVerificationEmail: async ({ user, url, token }, request) => {\n      await sendEmail({\n        to: user.email,\n        subject: \"Verify your email address\",\n        text: `Click the link to verify your email: ${url}`,\n      });\n    },\n  },\n});\n","ts","",[131],{"type":36,"tag":55,"props":132,"children":133},{"__ignoreMap":129},[134,188,237,247,287,307,379,400,431,461,503,520,529,538],{"type":36,"tag":135,"props":136,"children":139},"span",{"class":137,"line":138},"line",1,[140,146,152,158,163,168,173,178,183],{"type":36,"tag":135,"props":141,"children":143},{"style":142},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[144],{"type":42,"value":145},"import",{"type":36,"tag":135,"props":147,"children":149},{"style":148},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[150],{"type":42,"value":151}," {",{"type":36,"tag":135,"props":153,"children":155},{"style":154},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[156],{"type":42,"value":157}," betterAuth",{"type":36,"tag":135,"props":159,"children":160},{"style":148},[161],{"type":42,"value":162}," }",{"type":36,"tag":135,"props":164,"children":165},{"style":142},[166],{"type":42,"value":167}," from",{"type":36,"tag":135,"props":169,"children":170},{"style":148},[171],{"type":42,"value":172}," \"",{"type":36,"tag":135,"props":174,"children":176},{"style":175},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[177],{"type":42,"value":8},{"type":36,"tag":135,"props":179,"children":180},{"style":148},[181],{"type":42,"value":182},"\"",{"type":36,"tag":135,"props":184,"children":185},{"style":148},[186],{"type":42,"value":187},";\n",{"type":36,"tag":135,"props":189,"children":191},{"class":137,"line":190},2,[192,196,200,205,209,213,217,222,226,231],{"type":36,"tag":135,"props":193,"children":194},{"style":142},[195],{"type":42,"value":145},{"type":36,"tag":135,"props":197,"children":198},{"style":148},[199],{"type":42,"value":151},{"type":36,"tag":135,"props":201,"children":202},{"style":154},[203],{"type":42,"value":204}," sendEmail",{"type":36,"tag":135,"props":206,"children":207},{"style":148},[208],{"type":42,"value":162},{"type":36,"tag":135,"props":210,"children":211},{"style":142},[212],{"type":42,"value":167},{"type":36,"tag":135,"props":214,"children":215},{"style":148},[216],{"type":42,"value":172},{"type":36,"tag":135,"props":218,"children":219},{"style":175},[220],{"type":42,"value":221},".\u002Femail",{"type":36,"tag":135,"props":223,"children":224},{"style":148},[225],{"type":42,"value":182},{"type":36,"tag":135,"props":227,"children":228},{"style":148},[229],{"type":42,"value":230},";",{"type":36,"tag":135,"props":232,"children":234},{"style":233},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[235],{"type":42,"value":236}," \u002F\u002F your email sending function\n",{"type":36,"tag":135,"props":238,"children":240},{"class":137,"line":239},3,[241],{"type":36,"tag":135,"props":242,"children":244},{"emptyLinePlaceholder":243},true,[245],{"type":42,"value":246},"\n",{"type":36,"tag":135,"props":248,"children":250},{"class":137,"line":249},4,[251,256,262,267,272,277,282],{"type":36,"tag":135,"props":252,"children":253},{"style":142},[254],{"type":42,"value":255},"export",{"type":36,"tag":135,"props":257,"children":259},{"style":258},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[260],{"type":42,"value":261}," const",{"type":36,"tag":135,"props":263,"children":264},{"style":154},[265],{"type":42,"value":266}," auth ",{"type":36,"tag":135,"props":268,"children":269},{"style":148},[270],{"type":42,"value":271},"=",{"type":36,"tag":135,"props":273,"children":275},{"style":274},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[276],{"type":42,"value":157},{"type":36,"tag":135,"props":278,"children":279},{"style":154},[280],{"type":42,"value":281},"(",{"type":36,"tag":135,"props":283,"children":284},{"style":148},[285],{"type":42,"value":286},"{\n",{"type":36,"tag":135,"props":288,"children":290},{"class":137,"line":289},5,[291,297,302],{"type":36,"tag":135,"props":292,"children":294},{"style":293},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[295],{"type":42,"value":296},"  emailVerification",{"type":36,"tag":135,"props":298,"children":299},{"style":148},[300],{"type":42,"value":301},":",{"type":36,"tag":135,"props":303,"children":304},{"style":148},[305],{"type":42,"value":306}," {\n",{"type":36,"tag":135,"props":308,"children":310},{"class":137,"line":309},6,[311,316,320,325,330,336,341,346,350,355,360,365,370,375],{"type":36,"tag":135,"props":312,"children":313},{"style":274},[314],{"type":42,"value":315},"    sendVerificationEmail",{"type":36,"tag":135,"props":317,"children":318},{"style":148},[319],{"type":42,"value":301},{"type":36,"tag":135,"props":321,"children":322},{"style":258},[323],{"type":42,"value":324}," async",{"type":36,"tag":135,"props":326,"children":327},{"style":148},[328],{"type":42,"value":329}," ({",{"type":36,"tag":135,"props":331,"children":333},{"style":332},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[334],{"type":42,"value":335}," user",{"type":36,"tag":135,"props":337,"children":338},{"style":148},[339],{"type":42,"value":340},",",{"type":36,"tag":135,"props":342,"children":343},{"style":332},[344],{"type":42,"value":345}," url",{"type":36,"tag":135,"props":347,"children":348},{"style":148},[349],{"type":42,"value":340},{"type":36,"tag":135,"props":351,"children":352},{"style":332},[353],{"type":42,"value":354}," token",{"type":36,"tag":135,"props":356,"children":357},{"style":148},[358],{"type":42,"value":359}," },",{"type":36,"tag":135,"props":361,"children":362},{"style":332},[363],{"type":42,"value":364}," request",{"type":36,"tag":135,"props":366,"children":367},{"style":148},[368],{"type":42,"value":369},")",{"type":36,"tag":135,"props":371,"children":372},{"style":258},[373],{"type":42,"value":374}," =>",{"type":36,"tag":135,"props":376,"children":377},{"style":148},[378],{"type":42,"value":306},{"type":36,"tag":135,"props":380,"children":382},{"class":137,"line":381},7,[383,388,392,396],{"type":36,"tag":135,"props":384,"children":385},{"style":142},[386],{"type":42,"value":387},"      await",{"type":36,"tag":135,"props":389,"children":390},{"style":274},[391],{"type":42,"value":204},{"type":36,"tag":135,"props":393,"children":394},{"style":293},[395],{"type":42,"value":281},{"type":36,"tag":135,"props":397,"children":398},{"style":148},[399],{"type":42,"value":286},{"type":36,"tag":135,"props":401,"children":403},{"class":137,"line":402},8,[404,409,413,417,422,426],{"type":36,"tag":135,"props":405,"children":406},{"style":293},[407],{"type":42,"value":408},"        to",{"type":36,"tag":135,"props":410,"children":411},{"style":148},[412],{"type":42,"value":301},{"type":36,"tag":135,"props":414,"children":415},{"style":154},[416],{"type":42,"value":335},{"type":36,"tag":135,"props":418,"children":419},{"style":148},[420],{"type":42,"value":421},".",{"type":36,"tag":135,"props":423,"children":424},{"style":154},[425],{"type":42,"value":19},{"type":36,"tag":135,"props":427,"children":428},{"style":148},[429],{"type":42,"value":430},",\n",{"type":36,"tag":135,"props":432,"children":434},{"class":137,"line":433},9,[435,440,444,448,453,457],{"type":36,"tag":135,"props":436,"children":437},{"style":293},[438],{"type":42,"value":439},"        subject",{"type":36,"tag":135,"props":441,"children":442},{"style":148},[443],{"type":42,"value":301},{"type":36,"tag":135,"props":445,"children":446},{"style":148},[447],{"type":42,"value":172},{"type":36,"tag":135,"props":449,"children":450},{"style":175},[451],{"type":42,"value":452},"Verify your email address",{"type":36,"tag":135,"props":454,"children":455},{"style":148},[456],{"type":42,"value":182},{"type":36,"tag":135,"props":458,"children":459},{"style":148},[460],{"type":42,"value":430},{"type":36,"tag":135,"props":462,"children":464},{"class":137,"line":463},10,[465,470,474,479,484,489,494,499],{"type":36,"tag":135,"props":466,"children":467},{"style":293},[468],{"type":42,"value":469},"        text",{"type":36,"tag":135,"props":471,"children":472},{"style":148},[473],{"type":42,"value":301},{"type":36,"tag":135,"props":475,"children":476},{"style":148},[477],{"type":42,"value":478}," `",{"type":36,"tag":135,"props":480,"children":481},{"style":175},[482],{"type":42,"value":483},"Click the link to verify your email: ",{"type":36,"tag":135,"props":485,"children":486},{"style":148},[487],{"type":42,"value":488},"${",{"type":36,"tag":135,"props":490,"children":491},{"style":154},[492],{"type":42,"value":493},"url",{"type":36,"tag":135,"props":495,"children":496},{"style":148},[497],{"type":42,"value":498},"}`",{"type":36,"tag":135,"props":500,"children":501},{"style":148},[502],{"type":42,"value":430},{"type":36,"tag":135,"props":504,"children":506},{"class":137,"line":505},11,[507,512,516],{"type":36,"tag":135,"props":508,"children":509},{"style":148},[510],{"type":42,"value":511},"      }",{"type":36,"tag":135,"props":513,"children":514},{"style":293},[515],{"type":42,"value":369},{"type":36,"tag":135,"props":517,"children":518},{"style":148},[519],{"type":42,"value":187},{"type":36,"tag":135,"props":521,"children":523},{"class":137,"line":522},12,[524],{"type":36,"tag":135,"props":525,"children":526},{"style":148},[527],{"type":42,"value":528},"    },\n",{"type":36,"tag":135,"props":530,"children":532},{"class":137,"line":531},13,[533],{"type":36,"tag":135,"props":534,"children":535},{"style":148},[536],{"type":42,"value":537},"  },\n",{"type":36,"tag":135,"props":539,"children":541},{"class":137,"line":540},14,[542,547,551],{"type":36,"tag":135,"props":543,"children":544},{"style":148},[545],{"type":42,"value":546},"}",{"type":36,"tag":135,"props":548,"children":549},{"style":154},[550],{"type":42,"value":369},{"type":36,"tag":135,"props":552,"children":553},{"style":148},[554],{"type":42,"value":187},{"type":36,"tag":112,"props":556,"children":557},{},[558,564,566,571,573,579],{"type":36,"tag":559,"props":560,"children":561},"strong",{},[562],{"type":42,"value":563},"Note",{"type":42,"value":565},": The ",{"type":36,"tag":55,"props":567,"children":569},{"className":568},[],[570],{"type":42,"value":493},{"type":42,"value":572}," parameter contains the full verification link. The ",{"type":36,"tag":55,"props":574,"children":576},{"className":575},[],[577],{"type":42,"value":578},"token",{"type":42,"value":580}," is available if you need to build a custom verification URL.",{"type":36,"tag":582,"props":583,"children":585},"h3",{"id":584},"requiring-email-verification",[586],{"type":42,"value":587},"Requiring Email Verification",{"type":36,"tag":112,"props":589,"children":590},{},[591,593,599],{"type":42,"value":592},"For stricter security, enable ",{"type":36,"tag":55,"props":594,"children":596},{"className":595},[],[597],{"type":42,"value":598},"emailAndPassword.requireEmailVerification",{"type":42,"value":600}," to block sign-in until the user verifies their email. When enabled, unverified users will receive a new verification email on each sign-in attempt.",{"type":36,"tag":124,"props":602,"children":604},{"className":126,"code":603,"language":128,"meta":129,"style":129},"export const auth = betterAuth({\n  emailAndPassword: {\n    requireEmailVerification: true,\n  },\n});\n",[605],{"type":36,"tag":55,"props":606,"children":607},{"__ignoreMap":129},[608,639,655,677,684],{"type":36,"tag":135,"props":609,"children":610},{"class":137,"line":138},[611,615,619,623,627,631,635],{"type":36,"tag":135,"props":612,"children":613},{"style":142},[614],{"type":42,"value":255},{"type":36,"tag":135,"props":616,"children":617},{"style":258},[618],{"type":42,"value":261},{"type":36,"tag":135,"props":620,"children":621},{"style":154},[622],{"type":42,"value":266},{"type":36,"tag":135,"props":624,"children":625},{"style":148},[626],{"type":42,"value":271},{"type":36,"tag":135,"props":628,"children":629},{"style":274},[630],{"type":42,"value":157},{"type":36,"tag":135,"props":632,"children":633},{"style":154},[634],{"type":42,"value":281},{"type":36,"tag":135,"props":636,"children":637},{"style":148},[638],{"type":42,"value":286},{"type":36,"tag":135,"props":640,"children":641},{"class":137,"line":190},[642,647,651],{"type":36,"tag":135,"props":643,"children":644},{"style":293},[645],{"type":42,"value":646},"  emailAndPassword",{"type":36,"tag":135,"props":648,"children":649},{"style":148},[650],{"type":42,"value":301},{"type":36,"tag":135,"props":652,"children":653},{"style":148},[654],{"type":42,"value":306},{"type":36,"tag":135,"props":656,"children":657},{"class":137,"line":239},[658,663,667,673],{"type":36,"tag":135,"props":659,"children":660},{"style":293},[661],{"type":42,"value":662},"    requireEmailVerification",{"type":36,"tag":135,"props":664,"children":665},{"style":148},[666],{"type":42,"value":301},{"type":36,"tag":135,"props":668,"children":670},{"style":669},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[671],{"type":42,"value":672}," true",{"type":36,"tag":135,"props":674,"children":675},{"style":148},[676],{"type":42,"value":430},{"type":36,"tag":135,"props":678,"children":679},{"class":137,"line":249},[680],{"type":36,"tag":135,"props":681,"children":682},{"style":148},[683],{"type":42,"value":537},{"type":36,"tag":135,"props":685,"children":686},{"class":137,"line":289},[687,691,695],{"type":36,"tag":135,"props":688,"children":689},{"style":148},[690],{"type":42,"value":546},{"type":36,"tag":135,"props":692,"children":693},{"style":154},[694],{"type":42,"value":369},{"type":36,"tag":135,"props":696,"children":697},{"style":148},[698],{"type":42,"value":187},{"type":36,"tag":112,"props":700,"children":701},{},[702,706,708,714],{"type":36,"tag":559,"props":703,"children":704},{},[705],{"type":42,"value":563},{"type":42,"value":707},": This requires ",{"type":36,"tag":55,"props":709,"children":711},{"className":710},[],[712],{"type":42,"value":713},"sendVerificationEmail",{"type":42,"value":715}," to be configured and only applies to email\u002Fpassword sign-ins.",{"type":36,"tag":37,"props":717,"children":719},{"id":718},"client-side-validation",[720],{"type":42,"value":721},"Client Side Validation",{"type":36,"tag":112,"props":723,"children":724},{},[725],{"type":42,"value":726},"Implement client-side validation for immediate user feedback and reduced server load.",{"type":36,"tag":37,"props":728,"children":730},{"id":729},"callback-urls",[731],{"type":42,"value":732},"Callback URLs",{"type":36,"tag":112,"props":734,"children":735},{},[736],{"type":42,"value":737},"Always use absolute URLs (including the origin) for callback URLs in sign-up and sign-in requests. This prevents Better Auth from needing to infer the origin, which can cause issues when your backend and frontend are on different domains.",{"type":36,"tag":124,"props":739,"children":741},{"className":126,"code":740,"language":128,"meta":129,"style":129},"const { data, error } = await authClient.signUp.email({\n  callbackURL: \"https:\u002F\u002Fexample.com\u002Fcallback\", \u002F\u002F absolute URL with origin\n});\n",[742],{"type":36,"tag":55,"props":743,"children":744},{"__ignoreMap":129},[745,815,849],{"type":36,"tag":135,"props":746,"children":747},{"class":137,"line":138},[748,753,757,762,766,771,775,780,785,790,794,799,803,807,811],{"type":36,"tag":135,"props":749,"children":750},{"style":258},[751],{"type":42,"value":752},"const",{"type":36,"tag":135,"props":754,"children":755},{"style":148},[756],{"type":42,"value":151},{"type":36,"tag":135,"props":758,"children":759},{"style":154},[760],{"type":42,"value":761}," data",{"type":36,"tag":135,"props":763,"children":764},{"style":148},[765],{"type":42,"value":340},{"type":36,"tag":135,"props":767,"children":768},{"style":154},[769],{"type":42,"value":770}," error ",{"type":36,"tag":135,"props":772,"children":773},{"style":148},[774],{"type":42,"value":546},{"type":36,"tag":135,"props":776,"children":777},{"style":148},[778],{"type":42,"value":779}," =",{"type":36,"tag":135,"props":781,"children":782},{"style":142},[783],{"type":42,"value":784}," await",{"type":36,"tag":135,"props":786,"children":787},{"style":154},[788],{"type":42,"value":789}," authClient",{"type":36,"tag":135,"props":791,"children":792},{"style":148},[793],{"type":42,"value":421},{"type":36,"tag":135,"props":795,"children":796},{"style":154},[797],{"type":42,"value":798},"signUp",{"type":36,"tag":135,"props":800,"children":801},{"style":148},[802],{"type":42,"value":421},{"type":36,"tag":135,"props":804,"children":805},{"style":274},[806],{"type":42,"value":19},{"type":36,"tag":135,"props":808,"children":809},{"style":154},[810],{"type":42,"value":281},{"type":36,"tag":135,"props":812,"children":813},{"style":148},[814],{"type":42,"value":286},{"type":36,"tag":135,"props":816,"children":817},{"class":137,"line":190},[818,823,827,831,836,840,844],{"type":36,"tag":135,"props":819,"children":820},{"style":293},[821],{"type":42,"value":822},"  callbackURL",{"type":36,"tag":135,"props":824,"children":825},{"style":148},[826],{"type":42,"value":301},{"type":36,"tag":135,"props":828,"children":829},{"style":148},[830],{"type":42,"value":172},{"type":36,"tag":135,"props":832,"children":833},{"style":175},[834],{"type":42,"value":835},"https:\u002F\u002Fexample.com\u002Fcallback",{"type":36,"tag":135,"props":837,"children":838},{"style":148},[839],{"type":42,"value":182},{"type":36,"tag":135,"props":841,"children":842},{"style":148},[843],{"type":42,"value":340},{"type":36,"tag":135,"props":845,"children":846},{"style":233},[847],{"type":42,"value":848}," \u002F\u002F absolute URL with origin\n",{"type":36,"tag":135,"props":850,"children":851},{"class":137,"line":239},[852,856,860],{"type":36,"tag":135,"props":853,"children":854},{"style":148},[855],{"type":42,"value":546},{"type":36,"tag":135,"props":857,"children":858},{"style":154},[859],{"type":42,"value":369},{"type":36,"tag":135,"props":861,"children":862},{"style":148},[863],{"type":42,"value":187},{"type":36,"tag":37,"props":865,"children":867},{"id":866},"password-reset-flows",[868],{"type":42,"value":869},"Password Reset Flows",{"type":36,"tag":112,"props":871,"children":872},{},[873,875,880],{"type":42,"value":874},"Provide ",{"type":36,"tag":55,"props":876,"children":878},{"className":877},[],[879],{"type":42,"value":82},{"type":42,"value":881}," in the email and password config to enable password resets.",{"type":36,"tag":124,"props":883,"children":885},{"className":126,"code":884,"language":128,"meta":129,"style":129},"import { betterAuth } from \"better-auth\";\nimport { sendEmail } from \".\u002Femail\"; \u002F\u002F your email sending function\n\nexport const auth = betterAuth({\n  emailAndPassword: {\n    enabled: true,\n    \u002F\u002F Custom email sending function to send reset-password email\n    sendResetPassword: async ({ user, url, token }, request) => {\n      void sendEmail({\n        to: user.email,\n        subject: \"Reset your password\",\n        text: `Click the link to reset your password: ${url}`,\n      });\n    },\n    \u002F\u002F Optional event hook\n    onPasswordReset: async ({ user }, request) => {\n      \u002F\u002F your logic here\n      console.log(`Password for user ${user.email} has been reset.`);\n    },\n  },\n});\n",[886],{"type":36,"tag":55,"props":887,"children":888},{"__ignoreMap":129},[889,928,971,978,1009,1024,1044,1052,1112,1132,1159,1187,1223,1238,1245,1254,1299,1308,1378,1386,1394],{"type":36,"tag":135,"props":890,"children":891},{"class":137,"line":138},[892,896,900,904,908,912,916,920,924],{"type":36,"tag":135,"props":893,"children":894},{"style":142},[895],{"type":42,"value":145},{"type":36,"tag":135,"props":897,"children":898},{"style":148},[899],{"type":42,"value":151},{"type":36,"tag":135,"props":901,"children":902},{"style":154},[903],{"type":42,"value":157},{"type":36,"tag":135,"props":905,"children":906},{"style":148},[907],{"type":42,"value":162},{"type":36,"tag":135,"props":909,"children":910},{"style":142},[911],{"type":42,"value":167},{"type":36,"tag":135,"props":913,"children":914},{"style":148},[915],{"type":42,"value":172},{"type":36,"tag":135,"props":917,"children":918},{"style":175},[919],{"type":42,"value":8},{"type":36,"tag":135,"props":921,"children":922},{"style":148},[923],{"type":42,"value":182},{"type":36,"tag":135,"props":925,"children":926},{"style":148},[927],{"type":42,"value":187},{"type":36,"tag":135,"props":929,"children":930},{"class":137,"line":190},[931,935,939,943,947,951,955,959,963,967],{"type":36,"tag":135,"props":932,"children":933},{"style":142},[934],{"type":42,"value":145},{"type":36,"tag":135,"props":936,"children":937},{"style":148},[938],{"type":42,"value":151},{"type":36,"tag":135,"props":940,"children":941},{"style":154},[942],{"type":42,"value":204},{"type":36,"tag":135,"props":944,"children":945},{"style":148},[946],{"type":42,"value":162},{"type":36,"tag":135,"props":948,"children":949},{"style":142},[950],{"type":42,"value":167},{"type":36,"tag":135,"props":952,"children":953},{"style":148},[954],{"type":42,"value":172},{"type":36,"tag":135,"props":956,"children":957},{"style":175},[958],{"type":42,"value":221},{"type":36,"tag":135,"props":960,"children":961},{"style":148},[962],{"type":42,"value":182},{"type":36,"tag":135,"props":964,"children":965},{"style":148},[966],{"type":42,"value":230},{"type":36,"tag":135,"props":968,"children":969},{"style":233},[970],{"type":42,"value":236},{"type":36,"tag":135,"props":972,"children":973},{"class":137,"line":239},[974],{"type":36,"tag":135,"props":975,"children":976},{"emptyLinePlaceholder":243},[977],{"type":42,"value":246},{"type":36,"tag":135,"props":979,"children":980},{"class":137,"line":249},[981,985,989,993,997,1001,1005],{"type":36,"tag":135,"props":982,"children":983},{"style":142},[984],{"type":42,"value":255},{"type":36,"tag":135,"props":986,"children":987},{"style":258},[988],{"type":42,"value":261},{"type":36,"tag":135,"props":990,"children":991},{"style":154},[992],{"type":42,"value":266},{"type":36,"tag":135,"props":994,"children":995},{"style":148},[996],{"type":42,"value":271},{"type":36,"tag":135,"props":998,"children":999},{"style":274},[1000],{"type":42,"value":157},{"type":36,"tag":135,"props":1002,"children":1003},{"style":154},[1004],{"type":42,"value":281},{"type":36,"tag":135,"props":1006,"children":1007},{"style":148},[1008],{"type":42,"value":286},{"type":36,"tag":135,"props":1010,"children":1011},{"class":137,"line":289},[1012,1016,1020],{"type":36,"tag":135,"props":1013,"children":1014},{"style":293},[1015],{"type":42,"value":646},{"type":36,"tag":135,"props":1017,"children":1018},{"style":148},[1019],{"type":42,"value":301},{"type":36,"tag":135,"props":1021,"children":1022},{"style":148},[1023],{"type":42,"value":306},{"type":36,"tag":135,"props":1025,"children":1026},{"class":137,"line":309},[1027,1032,1036,1040],{"type":36,"tag":135,"props":1028,"children":1029},{"style":293},[1030],{"type":42,"value":1031},"    enabled",{"type":36,"tag":135,"props":1033,"children":1034},{"style":148},[1035],{"type":42,"value":301},{"type":36,"tag":135,"props":1037,"children":1038},{"style":669},[1039],{"type":42,"value":672},{"type":36,"tag":135,"props":1041,"children":1042},{"style":148},[1043],{"type":42,"value":430},{"type":36,"tag":135,"props":1045,"children":1046},{"class":137,"line":381},[1047],{"type":36,"tag":135,"props":1048,"children":1049},{"style":233},[1050],{"type":42,"value":1051},"    \u002F\u002F Custom email sending function to send reset-password email\n",{"type":36,"tag":135,"props":1053,"children":1054},{"class":137,"line":402},[1055,1060,1064,1068,1072,1076,1080,1084,1088,1092,1096,1100,1104,1108],{"type":36,"tag":135,"props":1056,"children":1057},{"style":274},[1058],{"type":42,"value":1059},"    sendResetPassword",{"type":36,"tag":135,"props":1061,"children":1062},{"style":148},[1063],{"type":42,"value":301},{"type":36,"tag":135,"props":1065,"children":1066},{"style":258},[1067],{"type":42,"value":324},{"type":36,"tag":135,"props":1069,"children":1070},{"style":148},[1071],{"type":42,"value":329},{"type":36,"tag":135,"props":1073,"children":1074},{"style":332},[1075],{"type":42,"value":335},{"type":36,"tag":135,"props":1077,"children":1078},{"style":148},[1079],{"type":42,"value":340},{"type":36,"tag":135,"props":1081,"children":1082},{"style":332},[1083],{"type":42,"value":345},{"type":36,"tag":135,"props":1085,"children":1086},{"style":148},[1087],{"type":42,"value":340},{"type":36,"tag":135,"props":1089,"children":1090},{"style":332},[1091],{"type":42,"value":354},{"type":36,"tag":135,"props":1093,"children":1094},{"style":148},[1095],{"type":42,"value":359},{"type":36,"tag":135,"props":1097,"children":1098},{"style":332},[1099],{"type":42,"value":364},{"type":36,"tag":135,"props":1101,"children":1102},{"style":148},[1103],{"type":42,"value":369},{"type":36,"tag":135,"props":1105,"children":1106},{"style":258},[1107],{"type":42,"value":374},{"type":36,"tag":135,"props":1109,"children":1110},{"style":148},[1111],{"type":42,"value":306},{"type":36,"tag":135,"props":1113,"children":1114},{"class":137,"line":433},[1115,1120,1124,1128],{"type":36,"tag":135,"props":1116,"children":1117},{"style":148},[1118],{"type":42,"value":1119},"      void",{"type":36,"tag":135,"props":1121,"children":1122},{"style":274},[1123],{"type":42,"value":204},{"type":36,"tag":135,"props":1125,"children":1126},{"style":293},[1127],{"type":42,"value":281},{"type":36,"tag":135,"props":1129,"children":1130},{"style":148},[1131],{"type":42,"value":286},{"type":36,"tag":135,"props":1133,"children":1134},{"class":137,"line":463},[1135,1139,1143,1147,1151,1155],{"type":36,"tag":135,"props":1136,"children":1137},{"style":293},[1138],{"type":42,"value":408},{"type":36,"tag":135,"props":1140,"children":1141},{"style":148},[1142],{"type":42,"value":301},{"type":36,"tag":135,"props":1144,"children":1145},{"style":154},[1146],{"type":42,"value":335},{"type":36,"tag":135,"props":1148,"children":1149},{"style":148},[1150],{"type":42,"value":421},{"type":36,"tag":135,"props":1152,"children":1153},{"style":154},[1154],{"type":42,"value":19},{"type":36,"tag":135,"props":1156,"children":1157},{"style":148},[1158],{"type":42,"value":430},{"type":36,"tag":135,"props":1160,"children":1161},{"class":137,"line":505},[1162,1166,1170,1174,1179,1183],{"type":36,"tag":135,"props":1163,"children":1164},{"style":293},[1165],{"type":42,"value":439},{"type":36,"tag":135,"props":1167,"children":1168},{"style":148},[1169],{"type":42,"value":301},{"type":36,"tag":135,"props":1171,"children":1172},{"style":148},[1173],{"type":42,"value":172},{"type":36,"tag":135,"props":1175,"children":1176},{"style":175},[1177],{"type":42,"value":1178},"Reset your password",{"type":36,"tag":135,"props":1180,"children":1181},{"style":148},[1182],{"type":42,"value":182},{"type":36,"tag":135,"props":1184,"children":1185},{"style":148},[1186],{"type":42,"value":430},{"type":36,"tag":135,"props":1188,"children":1189},{"class":137,"line":522},[1190,1194,1198,1202,1207,1211,1215,1219],{"type":36,"tag":135,"props":1191,"children":1192},{"style":293},[1193],{"type":42,"value":469},{"type":36,"tag":135,"props":1195,"children":1196},{"style":148},[1197],{"type":42,"value":301},{"type":36,"tag":135,"props":1199,"children":1200},{"style":148},[1201],{"type":42,"value":478},{"type":36,"tag":135,"props":1203,"children":1204},{"style":175},[1205],{"type":42,"value":1206},"Click the link to reset your password: ",{"type":36,"tag":135,"props":1208,"children":1209},{"style":148},[1210],{"type":42,"value":488},{"type":36,"tag":135,"props":1212,"children":1213},{"style":154},[1214],{"type":42,"value":493},{"type":36,"tag":135,"props":1216,"children":1217},{"style":148},[1218],{"type":42,"value":498},{"type":36,"tag":135,"props":1220,"children":1221},{"style":148},[1222],{"type":42,"value":430},{"type":36,"tag":135,"props":1224,"children":1225},{"class":137,"line":531},[1226,1230,1234],{"type":36,"tag":135,"props":1227,"children":1228},{"style":148},[1229],{"type":42,"value":511},{"type":36,"tag":135,"props":1231,"children":1232},{"style":293},[1233],{"type":42,"value":369},{"type":36,"tag":135,"props":1235,"children":1236},{"style":148},[1237],{"type":42,"value":187},{"type":36,"tag":135,"props":1239,"children":1240},{"class":137,"line":540},[1241],{"type":36,"tag":135,"props":1242,"children":1243},{"style":148},[1244],{"type":42,"value":528},{"type":36,"tag":135,"props":1246,"children":1248},{"class":137,"line":1247},15,[1249],{"type":36,"tag":135,"props":1250,"children":1251},{"style":233},[1252],{"type":42,"value":1253},"    \u002F\u002F Optional event hook\n",{"type":36,"tag":135,"props":1255,"children":1257},{"class":137,"line":1256},16,[1258,1263,1267,1271,1275,1279,1283,1287,1291,1295],{"type":36,"tag":135,"props":1259,"children":1260},{"style":274},[1261],{"type":42,"value":1262},"    onPasswordReset",{"type":36,"tag":135,"props":1264,"children":1265},{"style":148},[1266],{"type":42,"value":301},{"type":36,"tag":135,"props":1268,"children":1269},{"style":258},[1270],{"type":42,"value":324},{"type":36,"tag":135,"props":1272,"children":1273},{"style":148},[1274],{"type":42,"value":329},{"type":36,"tag":135,"props":1276,"children":1277},{"style":332},[1278],{"type":42,"value":335},{"type":36,"tag":135,"props":1280,"children":1281},{"style":148},[1282],{"type":42,"value":359},{"type":36,"tag":135,"props":1284,"children":1285},{"style":332},[1286],{"type":42,"value":364},{"type":36,"tag":135,"props":1288,"children":1289},{"style":148},[1290],{"type":42,"value":369},{"type":36,"tag":135,"props":1292,"children":1293},{"style":258},[1294],{"type":42,"value":374},{"type":36,"tag":135,"props":1296,"children":1297},{"style":148},[1298],{"type":42,"value":306},{"type":36,"tag":135,"props":1300,"children":1302},{"class":137,"line":1301},17,[1303],{"type":36,"tag":135,"props":1304,"children":1305},{"style":233},[1306],{"type":42,"value":1307},"      \u002F\u002F your logic here\n",{"type":36,"tag":135,"props":1309,"children":1311},{"class":137,"line":1310},18,[1312,1317,1321,1326,1330,1335,1340,1344,1349,1353,1357,1361,1366,1370,1374],{"type":36,"tag":135,"props":1313,"children":1314},{"style":154},[1315],{"type":42,"value":1316},"      console",{"type":36,"tag":135,"props":1318,"children":1319},{"style":148},[1320],{"type":42,"value":421},{"type":36,"tag":135,"props":1322,"children":1323},{"style":274},[1324],{"type":42,"value":1325},"log",{"type":36,"tag":135,"props":1327,"children":1328},{"style":293},[1329],{"type":42,"value":281},{"type":36,"tag":135,"props":1331,"children":1332},{"style":148},[1333],{"type":42,"value":1334},"`",{"type":36,"tag":135,"props":1336,"children":1337},{"style":175},[1338],{"type":42,"value":1339},"Password for user ",{"type":36,"tag":135,"props":1341,"children":1342},{"style":148},[1343],{"type":42,"value":488},{"type":36,"tag":135,"props":1345,"children":1346},{"style":154},[1347],{"type":42,"value":1348},"user",{"type":36,"tag":135,"props":1350,"children":1351},{"style":148},[1352],{"type":42,"value":421},{"type":36,"tag":135,"props":1354,"children":1355},{"style":154},[1356],{"type":42,"value":19},{"type":36,"tag":135,"props":1358,"children":1359},{"style":148},[1360],{"type":42,"value":546},{"type":36,"tag":135,"props":1362,"children":1363},{"style":175},[1364],{"type":42,"value":1365}," has been reset.",{"type":36,"tag":135,"props":1367,"children":1368},{"style":148},[1369],{"type":42,"value":1334},{"type":36,"tag":135,"props":1371,"children":1372},{"style":293},[1373],{"type":42,"value":369},{"type":36,"tag":135,"props":1375,"children":1376},{"style":148},[1377],{"type":42,"value":187},{"type":36,"tag":135,"props":1379,"children":1381},{"class":137,"line":1380},19,[1382],{"type":36,"tag":135,"props":1383,"children":1384},{"style":148},[1385],{"type":42,"value":528},{"type":36,"tag":135,"props":1387,"children":1389},{"class":137,"line":1388},20,[1390],{"type":36,"tag":135,"props":1391,"children":1392},{"style":148},[1393],{"type":42,"value":537},{"type":36,"tag":135,"props":1395,"children":1397},{"class":137,"line":1396},21,[1398,1402,1406],{"type":36,"tag":135,"props":1399,"children":1400},{"style":148},[1401],{"type":42,"value":546},{"type":36,"tag":135,"props":1403,"children":1404},{"style":154},[1405],{"type":42,"value":369},{"type":36,"tag":135,"props":1407,"children":1408},{"style":148},[1409],{"type":42,"value":187},{"type":36,"tag":582,"props":1411,"children":1413},{"id":1412},"security-considerations",[1414],{"type":42,"value":1415},"Security Considerations",{"type":36,"tag":112,"props":1417,"children":1418},{},[1419],{"type":42,"value":1420},"Built-in protections: background email sending (timing attack prevention), dummy operations on invalid requests, constant response messages regardless of user existence.",{"type":36,"tag":112,"props":1422,"children":1423},{},[1424],{"type":42,"value":1425},"On serverless platforms, configure a background task handler:",{"type":36,"tag":124,"props":1427,"children":1429},{"className":126,"code":1428,"language":128,"meta":129,"style":129},"export const auth = betterAuth({\n  advanced: {\n    backgroundTasks: {\n      handler: (promise) => {\n        \u002F\u002F Use platform-specific methods like waitUntil\n        waitUntil(promise);\n      },\n    },\n  },\n});\n",[1430],{"type":36,"tag":55,"props":1431,"children":1432},{"__ignoreMap":129},[1433,1464,1480,1496,1530,1538,1562,1570,1577,1584],{"type":36,"tag":135,"props":1434,"children":1435},{"class":137,"line":138},[1436,1440,1444,1448,1452,1456,1460],{"type":36,"tag":135,"props":1437,"children":1438},{"style":142},[1439],{"type":42,"value":255},{"type":36,"tag":135,"props":1441,"children":1442},{"style":258},[1443],{"type":42,"value":261},{"type":36,"tag":135,"props":1445,"children":1446},{"style":154},[1447],{"type":42,"value":266},{"type":36,"tag":135,"props":1449,"children":1450},{"style":148},[1451],{"type":42,"value":271},{"type":36,"tag":135,"props":1453,"children":1454},{"style":274},[1455],{"type":42,"value":157},{"type":36,"tag":135,"props":1457,"children":1458},{"style":154},[1459],{"type":42,"value":281},{"type":36,"tag":135,"props":1461,"children":1462},{"style":148},[1463],{"type":42,"value":286},{"type":36,"tag":135,"props":1465,"children":1466},{"class":137,"line":190},[1467,1472,1476],{"type":36,"tag":135,"props":1468,"children":1469},{"style":293},[1470],{"type":42,"value":1471},"  advanced",{"type":36,"tag":135,"props":1473,"children":1474},{"style":148},[1475],{"type":42,"value":301},{"type":36,"tag":135,"props":1477,"children":1478},{"style":148},[1479],{"type":42,"value":306},{"type":36,"tag":135,"props":1481,"children":1482},{"class":137,"line":239},[1483,1488,1492],{"type":36,"tag":135,"props":1484,"children":1485},{"style":293},[1486],{"type":42,"value":1487},"    backgroundTasks",{"type":36,"tag":135,"props":1489,"children":1490},{"style":148},[1491],{"type":42,"value":301},{"type":36,"tag":135,"props":1493,"children":1494},{"style":148},[1495],{"type":42,"value":306},{"type":36,"tag":135,"props":1497,"children":1498},{"class":137,"line":249},[1499,1504,1508,1513,1518,1522,1526],{"type":36,"tag":135,"props":1500,"children":1501},{"style":274},[1502],{"type":42,"value":1503},"      handler",{"type":36,"tag":135,"props":1505,"children":1506},{"style":148},[1507],{"type":42,"value":301},{"type":36,"tag":135,"props":1509,"children":1510},{"style":148},[1511],{"type":42,"value":1512}," (",{"type":36,"tag":135,"props":1514,"children":1515},{"style":332},[1516],{"type":42,"value":1517},"promise",{"type":36,"tag":135,"props":1519,"children":1520},{"style":148},[1521],{"type":42,"value":369},{"type":36,"tag":135,"props":1523,"children":1524},{"style":258},[1525],{"type":42,"value":374},{"type":36,"tag":135,"props":1527,"children":1528},{"style":148},[1529],{"type":42,"value":306},{"type":36,"tag":135,"props":1531,"children":1532},{"class":137,"line":289},[1533],{"type":36,"tag":135,"props":1534,"children":1535},{"style":233},[1536],{"type":42,"value":1537},"        \u002F\u002F Use platform-specific methods like waitUntil\n",{"type":36,"tag":135,"props":1539,"children":1540},{"class":137,"line":309},[1541,1546,1550,1554,1558],{"type":36,"tag":135,"props":1542,"children":1543},{"style":274},[1544],{"type":42,"value":1545},"        waitUntil",{"type":36,"tag":135,"props":1547,"children":1548},{"style":293},[1549],{"type":42,"value":281},{"type":36,"tag":135,"props":1551,"children":1552},{"style":154},[1553],{"type":42,"value":1517},{"type":36,"tag":135,"props":1555,"children":1556},{"style":293},[1557],{"type":42,"value":369},{"type":36,"tag":135,"props":1559,"children":1560},{"style":148},[1561],{"type":42,"value":187},{"type":36,"tag":135,"props":1563,"children":1564},{"class":137,"line":381},[1565],{"type":36,"tag":135,"props":1566,"children":1567},{"style":148},[1568],{"type":42,"value":1569},"      },\n",{"type":36,"tag":135,"props":1571,"children":1572},{"class":137,"line":402},[1573],{"type":36,"tag":135,"props":1574,"children":1575},{"style":148},[1576],{"type":42,"value":528},{"type":36,"tag":135,"props":1578,"children":1579},{"class":137,"line":433},[1580],{"type":36,"tag":135,"props":1581,"children":1582},{"style":148},[1583],{"type":42,"value":537},{"type":36,"tag":135,"props":1585,"children":1586},{"class":137,"line":463},[1587,1591,1595],{"type":36,"tag":135,"props":1588,"children":1589},{"style":148},[1590],{"type":42,"value":546},{"type":36,"tag":135,"props":1592,"children":1593},{"style":154},[1594],{"type":42,"value":369},{"type":36,"tag":135,"props":1596,"children":1597},{"style":148},[1598],{"type":42,"value":187},{"type":36,"tag":1600,"props":1601,"children":1603},"h4",{"id":1602},"token-security",[1604],{"type":42,"value":1605},"Token Security",{"type":36,"tag":112,"props":1607,"children":1608},{},[1609,1611,1617],{"type":42,"value":1610},"Tokens expire after 1 hour by default. Configure with ",{"type":36,"tag":55,"props":1612,"children":1614},{"className":1613},[],[1615],{"type":42,"value":1616},"resetPasswordTokenExpiresIn",{"type":42,"value":1618}," (in seconds):",{"type":36,"tag":124,"props":1620,"children":1622},{"className":126,"code":1621,"language":128,"meta":129,"style":129},"export const auth = betterAuth({\n  emailAndPassword: {\n    enabled: true,\n    resetPasswordTokenExpiresIn: 60 * 30, \u002F\u002F 30 minutes\n  },\n});\n",[1623],{"type":36,"tag":55,"props":1624,"children":1625},{"__ignoreMap":129},[1626,1657,1672,1691,1728,1735],{"type":36,"tag":135,"props":1627,"children":1628},{"class":137,"line":138},[1629,1633,1637,1641,1645,1649,1653],{"type":36,"tag":135,"props":1630,"children":1631},{"style":142},[1632],{"type":42,"value":255},{"type":36,"tag":135,"props":1634,"children":1635},{"style":258},[1636],{"type":42,"value":261},{"type":36,"tag":135,"props":1638,"children":1639},{"style":154},[1640],{"type":42,"value":266},{"type":36,"tag":135,"props":1642,"children":1643},{"style":148},[1644],{"type":42,"value":271},{"type":36,"tag":135,"props":1646,"children":1647},{"style":274},[1648],{"type":42,"value":157},{"type":36,"tag":135,"props":1650,"children":1651},{"style":154},[1652],{"type":42,"value":281},{"type":36,"tag":135,"props":1654,"children":1655},{"style":148},[1656],{"type":42,"value":286},{"type":36,"tag":135,"props":1658,"children":1659},{"class":137,"line":190},[1660,1664,1668],{"type":36,"tag":135,"props":1661,"children":1662},{"style":293},[1663],{"type":42,"value":646},{"type":36,"tag":135,"props":1665,"children":1666},{"style":148},[1667],{"type":42,"value":301},{"type":36,"tag":135,"props":1669,"children":1670},{"style":148},[1671],{"type":42,"value":306},{"type":36,"tag":135,"props":1673,"children":1674},{"class":137,"line":239},[1675,1679,1683,1687],{"type":36,"tag":135,"props":1676,"children":1677},{"style":293},[1678],{"type":42,"value":1031},{"type":36,"tag":135,"props":1680,"children":1681},{"style":148},[1682],{"type":42,"value":301},{"type":36,"tag":135,"props":1684,"children":1685},{"style":669},[1686],{"type":42,"value":672},{"type":36,"tag":135,"props":1688,"children":1689},{"style":148},[1690],{"type":42,"value":430},{"type":36,"tag":135,"props":1692,"children":1693},{"class":137,"line":249},[1694,1699,1703,1709,1714,1719,1723],{"type":36,"tag":135,"props":1695,"children":1696},{"style":293},[1697],{"type":42,"value":1698},"    resetPasswordTokenExpiresIn",{"type":36,"tag":135,"props":1700,"children":1701},{"style":148},[1702],{"type":42,"value":301},{"type":36,"tag":135,"props":1704,"children":1706},{"style":1705},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1707],{"type":42,"value":1708}," 60",{"type":36,"tag":135,"props":1710,"children":1711},{"style":148},[1712],{"type":42,"value":1713}," *",{"type":36,"tag":135,"props":1715,"children":1716},{"style":1705},[1717],{"type":42,"value":1718}," 30",{"type":36,"tag":135,"props":1720,"children":1721},{"style":148},[1722],{"type":42,"value":340},{"type":36,"tag":135,"props":1724,"children":1725},{"style":233},[1726],{"type":42,"value":1727}," \u002F\u002F 30 minutes\n",{"type":36,"tag":135,"props":1729,"children":1730},{"class":137,"line":289},[1731],{"type":36,"tag":135,"props":1732,"children":1733},{"style":148},[1734],{"type":42,"value":537},{"type":36,"tag":135,"props":1736,"children":1737},{"class":137,"line":309},[1738,1742,1746],{"type":36,"tag":135,"props":1739,"children":1740},{"style":148},[1741],{"type":42,"value":546},{"type":36,"tag":135,"props":1743,"children":1744},{"style":154},[1745],{"type":42,"value":369},{"type":36,"tag":135,"props":1747,"children":1748},{"style":148},[1749],{"type":42,"value":187},{"type":36,"tag":112,"props":1751,"children":1752},{},[1753],{"type":42,"value":1754},"Tokens are single-use — deleted immediately after successful reset.",{"type":36,"tag":1600,"props":1756,"children":1758},{"id":1757},"session-revocation",[1759],{"type":42,"value":1760},"Session Revocation",{"type":36,"tag":112,"props":1762,"children":1763},{},[1764,1766,1772],{"type":42,"value":1765},"Enable ",{"type":36,"tag":55,"props":1767,"children":1769},{"className":1768},[],[1770],{"type":42,"value":1771},"revokeSessionsOnPasswordReset",{"type":42,"value":1773}," to invalidate all existing sessions on password reset:",{"type":36,"tag":124,"props":1775,"children":1777},{"className":126,"code":1776,"language":128,"meta":129,"style":129},"export const auth = betterAuth({\n  emailAndPassword: {\n    enabled: true,\n    revokeSessionsOnPasswordReset: true,\n  },\n});\n",[1778],{"type":36,"tag":55,"props":1779,"children":1780},{"__ignoreMap":129},[1781,1812,1827,1846,1866,1873],{"type":36,"tag":135,"props":1782,"children":1783},{"class":137,"line":138},[1784,1788,1792,1796,1800,1804,1808],{"type":36,"tag":135,"props":1785,"children":1786},{"style":142},[1787],{"type":42,"value":255},{"type":36,"tag":135,"props":1789,"children":1790},{"style":258},[1791],{"type":42,"value":261},{"type":36,"tag":135,"props":1793,"children":1794},{"style":154},[1795],{"type":42,"value":266},{"type":36,"tag":135,"props":1797,"children":1798},{"style":148},[1799],{"type":42,"value":271},{"type":36,"tag":135,"props":1801,"children":1802},{"style":274},[1803],{"type":42,"value":157},{"type":36,"tag":135,"props":1805,"children":1806},{"style":154},[1807],{"type":42,"value":281},{"type":36,"tag":135,"props":1809,"children":1810},{"style":148},[1811],{"type":42,"value":286},{"type":36,"tag":135,"props":1813,"children":1814},{"class":137,"line":190},[1815,1819,1823],{"type":36,"tag":135,"props":1816,"children":1817},{"style":293},[1818],{"type":42,"value":646},{"type":36,"tag":135,"props":1820,"children":1821},{"style":148},[1822],{"type":42,"value":301},{"type":36,"tag":135,"props":1824,"children":1825},{"style":148},[1826],{"type":42,"value":306},{"type":36,"tag":135,"props":1828,"children":1829},{"class":137,"line":239},[1830,1834,1838,1842],{"type":36,"tag":135,"props":1831,"children":1832},{"style":293},[1833],{"type":42,"value":1031},{"type":36,"tag":135,"props":1835,"children":1836},{"style":148},[1837],{"type":42,"value":301},{"type":36,"tag":135,"props":1839,"children":1840},{"style":669},[1841],{"type":42,"value":672},{"type":36,"tag":135,"props":1843,"children":1844},{"style":148},[1845],{"type":42,"value":430},{"type":36,"tag":135,"props":1847,"children":1848},{"class":137,"line":249},[1849,1854,1858,1862],{"type":36,"tag":135,"props":1850,"children":1851},{"style":293},[1852],{"type":42,"value":1853},"    revokeSessionsOnPasswordReset",{"type":36,"tag":135,"props":1855,"children":1856},{"style":148},[1857],{"type":42,"value":301},{"type":36,"tag":135,"props":1859,"children":1860},{"style":669},[1861],{"type":42,"value":672},{"type":36,"tag":135,"props":1863,"children":1864},{"style":148},[1865],{"type":42,"value":430},{"type":36,"tag":135,"props":1867,"children":1868},{"class":137,"line":289},[1869],{"type":36,"tag":135,"props":1870,"children":1871},{"style":148},[1872],{"type":42,"value":537},{"type":36,"tag":135,"props":1874,"children":1875},{"class":137,"line":309},[1876,1880,1884],{"type":36,"tag":135,"props":1877,"children":1878},{"style":148},[1879],{"type":42,"value":546},{"type":36,"tag":135,"props":1881,"children":1882},{"style":154},[1883],{"type":42,"value":369},{"type":36,"tag":135,"props":1885,"children":1886},{"style":148},[1887],{"type":42,"value":187},{"type":36,"tag":1600,"props":1889,"children":1891},{"id":1890},"password-requirements",[1892],{"type":42,"value":1893},"Password Requirements",{"type":36,"tag":112,"props":1895,"children":1896},{},[1897],{"type":42,"value":1898},"Password length limits (configurable):",{"type":36,"tag":124,"props":1900,"children":1902},{"className":126,"code":1901,"language":128,"meta":129,"style":129},"export const auth = betterAuth({\n  emailAndPassword: {\n    enabled: true,\n    minPasswordLength: 12,\n    maxPasswordLength: 256,\n  },\n});\n",[1903],{"type":36,"tag":55,"props":1904,"children":1905},{"__ignoreMap":129},[1906,1937,1952,1971,1992,2013,2020],{"type":36,"tag":135,"props":1907,"children":1908},{"class":137,"line":138},[1909,1913,1917,1921,1925,1929,1933],{"type":36,"tag":135,"props":1910,"children":1911},{"style":142},[1912],{"type":42,"value":255},{"type":36,"tag":135,"props":1914,"children":1915},{"style":258},[1916],{"type":42,"value":261},{"type":36,"tag":135,"props":1918,"children":1919},{"style":154},[1920],{"type":42,"value":266},{"type":36,"tag":135,"props":1922,"children":1923},{"style":148},[1924],{"type":42,"value":271},{"type":36,"tag":135,"props":1926,"children":1927},{"style":274},[1928],{"type":42,"value":157},{"type":36,"tag":135,"props":1930,"children":1931},{"style":154},[1932],{"type":42,"value":281},{"type":36,"tag":135,"props":1934,"children":1935},{"style":148},[1936],{"type":42,"value":286},{"type":36,"tag":135,"props":1938,"children":1939},{"class":137,"line":190},[1940,1944,1948],{"type":36,"tag":135,"props":1941,"children":1942},{"style":293},[1943],{"type":42,"value":646},{"type":36,"tag":135,"props":1945,"children":1946},{"style":148},[1947],{"type":42,"value":301},{"type":36,"tag":135,"props":1949,"children":1950},{"style":148},[1951],{"type":42,"value":306},{"type":36,"tag":135,"props":1953,"children":1954},{"class":137,"line":239},[1955,1959,1963,1967],{"type":36,"tag":135,"props":1956,"children":1957},{"style":293},[1958],{"type":42,"value":1031},{"type":36,"tag":135,"props":1960,"children":1961},{"style":148},[1962],{"type":42,"value":301},{"type":36,"tag":135,"props":1964,"children":1965},{"style":669},[1966],{"type":42,"value":672},{"type":36,"tag":135,"props":1968,"children":1969},{"style":148},[1970],{"type":42,"value":430},{"type":36,"tag":135,"props":1972,"children":1973},{"class":137,"line":249},[1974,1979,1983,1988],{"type":36,"tag":135,"props":1975,"children":1976},{"style":293},[1977],{"type":42,"value":1978},"    minPasswordLength",{"type":36,"tag":135,"props":1980,"children":1981},{"style":148},[1982],{"type":42,"value":301},{"type":36,"tag":135,"props":1984,"children":1985},{"style":1705},[1986],{"type":42,"value":1987}," 12",{"type":36,"tag":135,"props":1989,"children":1990},{"style":148},[1991],{"type":42,"value":430},{"type":36,"tag":135,"props":1993,"children":1994},{"class":137,"line":289},[1995,2000,2004,2009],{"type":36,"tag":135,"props":1996,"children":1997},{"style":293},[1998],{"type":42,"value":1999},"    maxPasswordLength",{"type":36,"tag":135,"props":2001,"children":2002},{"style":148},[2003],{"type":42,"value":301},{"type":36,"tag":135,"props":2005,"children":2006},{"style":1705},[2007],{"type":42,"value":2008}," 256",{"type":36,"tag":135,"props":2010,"children":2011},{"style":148},[2012],{"type":42,"value":430},{"type":36,"tag":135,"props":2014,"children":2015},{"class":137,"line":309},[2016],{"type":36,"tag":135,"props":2017,"children":2018},{"style":148},[2019],{"type":42,"value":537},{"type":36,"tag":135,"props":2021,"children":2022},{"class":137,"line":381},[2023,2027,2031],{"type":36,"tag":135,"props":2024,"children":2025},{"style":148},[2026],{"type":42,"value":546},{"type":36,"tag":135,"props":2028,"children":2029},{"style":154},[2030],{"type":42,"value":369},{"type":36,"tag":135,"props":2032,"children":2033},{"style":148},[2034],{"type":42,"value":187},{"type":36,"tag":582,"props":2036,"children":2038},{"id":2037},"sending-the-password-reset",[2039],{"type":42,"value":2040},"Sending the Password Reset",{"type":36,"tag":112,"props":2042,"children":2043},{},[2044,2046,2052,2054,2059],{"type":42,"value":2045},"Call ",{"type":36,"tag":55,"props":2047,"children":2049},{"className":2048},[],[2050],{"type":42,"value":2051},"requestPasswordReset",{"type":42,"value":2053}," to send the reset link. Triggers the ",{"type":36,"tag":55,"props":2055,"children":2057},{"className":2056},[],[2058],{"type":42,"value":82},{"type":42,"value":2060}," function from your config.",{"type":36,"tag":124,"props":2062,"children":2064},{"className":126,"code":2063,"language":128,"meta":129,"style":129},"const data = await auth.api.requestPasswordReset({\n  body: {\n    email: \"john.doe@example.com\", \u002F\u002F required\n    redirectTo: \"https:\u002F\u002Fexample.com\u002Freset-password\",\n  },\n});\n",[2065],{"type":36,"tag":55,"props":2066,"children":2067},{"__ignoreMap":129},[2068,2118,2134,2168,2197,2204],{"type":36,"tag":135,"props":2069,"children":2070},{"class":137,"line":138},[2071,2075,2080,2084,2088,2093,2097,2102,2106,2110,2114],{"type":36,"tag":135,"props":2072,"children":2073},{"style":258},[2074],{"type":42,"value":752},{"type":36,"tag":135,"props":2076,"children":2077},{"style":154},[2078],{"type":42,"value":2079}," data ",{"type":36,"tag":135,"props":2081,"children":2082},{"style":148},[2083],{"type":42,"value":271},{"type":36,"tag":135,"props":2085,"children":2086},{"style":142},[2087],{"type":42,"value":784},{"type":36,"tag":135,"props":2089,"children":2090},{"style":154},[2091],{"type":42,"value":2092}," auth",{"type":36,"tag":135,"props":2094,"children":2095},{"style":148},[2096],{"type":42,"value":421},{"type":36,"tag":135,"props":2098,"children":2099},{"style":154},[2100],{"type":42,"value":2101},"api",{"type":36,"tag":135,"props":2103,"children":2104},{"style":148},[2105],{"type":42,"value":421},{"type":36,"tag":135,"props":2107,"children":2108},{"style":274},[2109],{"type":42,"value":2051},{"type":36,"tag":135,"props":2111,"children":2112},{"style":154},[2113],{"type":42,"value":281},{"type":36,"tag":135,"props":2115,"children":2116},{"style":148},[2117],{"type":42,"value":286},{"type":36,"tag":135,"props":2119,"children":2120},{"class":137,"line":190},[2121,2126,2130],{"type":36,"tag":135,"props":2122,"children":2123},{"style":293},[2124],{"type":42,"value":2125},"  body",{"type":36,"tag":135,"props":2127,"children":2128},{"style":148},[2129],{"type":42,"value":301},{"type":36,"tag":135,"props":2131,"children":2132},{"style":148},[2133],{"type":42,"value":306},{"type":36,"tag":135,"props":2135,"children":2136},{"class":137,"line":239},[2137,2142,2146,2150,2155,2159,2163],{"type":36,"tag":135,"props":2138,"children":2139},{"style":293},[2140],{"type":42,"value":2141},"    email",{"type":36,"tag":135,"props":2143,"children":2144},{"style":148},[2145],{"type":42,"value":301},{"type":36,"tag":135,"props":2147,"children":2148},{"style":148},[2149],{"type":42,"value":172},{"type":36,"tag":135,"props":2151,"children":2152},{"style":175},[2153],{"type":42,"value":2154},"john.doe@example.com",{"type":36,"tag":135,"props":2156,"children":2157},{"style":148},[2158],{"type":42,"value":182},{"type":36,"tag":135,"props":2160,"children":2161},{"style":148},[2162],{"type":42,"value":340},{"type":36,"tag":135,"props":2164,"children":2165},{"style":233},[2166],{"type":42,"value":2167}," \u002F\u002F required\n",{"type":36,"tag":135,"props":2169,"children":2170},{"class":137,"line":249},[2171,2176,2180,2184,2189,2193],{"type":36,"tag":135,"props":2172,"children":2173},{"style":293},[2174],{"type":42,"value":2175},"    redirectTo",{"type":36,"tag":135,"props":2177,"children":2178},{"style":148},[2179],{"type":42,"value":301},{"type":36,"tag":135,"props":2181,"children":2182},{"style":148},[2183],{"type":42,"value":172},{"type":36,"tag":135,"props":2185,"children":2186},{"style":175},[2187],{"type":42,"value":2188},"https:\u002F\u002Fexample.com\u002Freset-password",{"type":36,"tag":135,"props":2190,"children":2191},{"style":148},[2192],{"type":42,"value":182},{"type":36,"tag":135,"props":2194,"children":2195},{"style":148},[2196],{"type":42,"value":430},{"type":36,"tag":135,"props":2198,"children":2199},{"class":137,"line":289},[2200],{"type":36,"tag":135,"props":2201,"children":2202},{"style":148},[2203],{"type":42,"value":537},{"type":36,"tag":135,"props":2205,"children":2206},{"class":137,"line":309},[2207,2211,2215],{"type":36,"tag":135,"props":2208,"children":2209},{"style":148},[2210],{"type":42,"value":546},{"type":36,"tag":135,"props":2212,"children":2213},{"style":154},[2214],{"type":42,"value":369},{"type":36,"tag":135,"props":2216,"children":2217},{"style":148},[2218],{"type":42,"value":187},{"type":36,"tag":112,"props":2220,"children":2221},{},[2222],{"type":42,"value":2223},"Or authClient:",{"type":36,"tag":124,"props":2225,"children":2227},{"className":126,"code":2226,"language":128,"meta":129,"style":129},"const { data, error } = await authClient.requestPasswordReset({\n  email: \"john.doe@example.com\", \u002F\u002F required\n  redirectTo: \"https:\u002F\u002Fexample.com\u002Freset-password\",\n});\n",[2228],{"type":36,"tag":55,"props":2229,"children":2230},{"__ignoreMap":129},[2231,2286,2318,2346],{"type":36,"tag":135,"props":2232,"children":2233},{"class":137,"line":138},[2234,2238,2242,2246,2250,2254,2258,2262,2266,2270,2274,2278,2282],{"type":36,"tag":135,"props":2235,"children":2236},{"style":258},[2237],{"type":42,"value":752},{"type":36,"tag":135,"props":2239,"children":2240},{"style":148},[2241],{"type":42,"value":151},{"type":36,"tag":135,"props":2243,"children":2244},{"style":154},[2245],{"type":42,"value":761},{"type":36,"tag":135,"props":2247,"children":2248},{"style":148},[2249],{"type":42,"value":340},{"type":36,"tag":135,"props":2251,"children":2252},{"style":154},[2253],{"type":42,"value":770},{"type":36,"tag":135,"props":2255,"children":2256},{"style":148},[2257],{"type":42,"value":546},{"type":36,"tag":135,"props":2259,"children":2260},{"style":148},[2261],{"type":42,"value":779},{"type":36,"tag":135,"props":2263,"children":2264},{"style":142},[2265],{"type":42,"value":784},{"type":36,"tag":135,"props":2267,"children":2268},{"style":154},[2269],{"type":42,"value":789},{"type":36,"tag":135,"props":2271,"children":2272},{"style":148},[2273],{"type":42,"value":421},{"type":36,"tag":135,"props":2275,"children":2276},{"style":274},[2277],{"type":42,"value":2051},{"type":36,"tag":135,"props":2279,"children":2280},{"style":154},[2281],{"type":42,"value":281},{"type":36,"tag":135,"props":2283,"children":2284},{"style":148},[2285],{"type":42,"value":286},{"type":36,"tag":135,"props":2287,"children":2288},{"class":137,"line":190},[2289,2294,2298,2302,2306,2310,2314],{"type":36,"tag":135,"props":2290,"children":2291},{"style":293},[2292],{"type":42,"value":2293},"  email",{"type":36,"tag":135,"props":2295,"children":2296},{"style":148},[2297],{"type":42,"value":301},{"type":36,"tag":135,"props":2299,"children":2300},{"style":148},[2301],{"type":42,"value":172},{"type":36,"tag":135,"props":2303,"children":2304},{"style":175},[2305],{"type":42,"value":2154},{"type":36,"tag":135,"props":2307,"children":2308},{"style":148},[2309],{"type":42,"value":182},{"type":36,"tag":135,"props":2311,"children":2312},{"style":148},[2313],{"type":42,"value":340},{"type":36,"tag":135,"props":2315,"children":2316},{"style":233},[2317],{"type":42,"value":2167},{"type":36,"tag":135,"props":2319,"children":2320},{"class":137,"line":239},[2321,2326,2330,2334,2338,2342],{"type":36,"tag":135,"props":2322,"children":2323},{"style":293},[2324],{"type":42,"value":2325},"  redirectTo",{"type":36,"tag":135,"props":2327,"children":2328},{"style":148},[2329],{"type":42,"value":301},{"type":36,"tag":135,"props":2331,"children":2332},{"style":148},[2333],{"type":42,"value":172},{"type":36,"tag":135,"props":2335,"children":2336},{"style":175},[2337],{"type":42,"value":2188},{"type":36,"tag":135,"props":2339,"children":2340},{"style":148},[2341],{"type":42,"value":182},{"type":36,"tag":135,"props":2343,"children":2344},{"style":148},[2345],{"type":42,"value":430},{"type":36,"tag":135,"props":2347,"children":2348},{"class":137,"line":249},[2349,2353,2357],{"type":36,"tag":135,"props":2350,"children":2351},{"style":148},[2352],{"type":42,"value":546},{"type":36,"tag":135,"props":2354,"children":2355},{"style":154},[2356],{"type":42,"value":369},{"type":36,"tag":135,"props":2358,"children":2359},{"style":148},[2360],{"type":42,"value":187},{"type":36,"tag":112,"props":2362,"children":2363},{},[2364,2368,2370,2375,2377,2383],{"type":36,"tag":559,"props":2365,"children":2366},{},[2367],{"type":42,"value":563},{"type":42,"value":2369},": While the ",{"type":36,"tag":55,"props":2371,"children":2373},{"className":2372},[],[2374],{"type":42,"value":19},{"type":42,"value":2376}," is required, we also recommend configuring the ",{"type":36,"tag":55,"props":2378,"children":2380},{"className":2379},[],[2381],{"type":42,"value":2382},"redirectTo",{"type":42,"value":2384}," for a smoother user experience.",{"type":36,"tag":37,"props":2386,"children":2388},{"id":2387},"password-hashing",[2389],{"type":42,"value":2390},"Password Hashing",{"type":36,"tag":112,"props":2392,"children":2393},{},[2394,2396,2402],{"type":42,"value":2395},"Default: ",{"type":36,"tag":55,"props":2397,"children":2399},{"className":2398},[],[2400],{"type":42,"value":2401},"scrypt",{"type":42,"value":2403}," (Node.js native, no external dependencies).",{"type":36,"tag":582,"props":2405,"children":2407},{"id":2406},"custom-hashing-algorithm",[2408],{"type":42,"value":2409},"Custom Hashing Algorithm",{"type":36,"tag":112,"props":2411,"children":2412},{},[2413,2415,2421,2423,2429],{"type":42,"value":2414},"To use Argon2id or another algorithm, provide custom ",{"type":36,"tag":55,"props":2416,"children":2418},{"className":2417},[],[2419],{"type":42,"value":2420},"hash",{"type":42,"value":2422}," and ",{"type":36,"tag":55,"props":2424,"children":2426},{"className":2425},[],[2427],{"type":42,"value":2428},"verify",{"type":42,"value":2430}," functions:",{"type":36,"tag":124,"props":2432,"children":2434},{"className":126,"code":2433,"language":128,"meta":129,"style":129},"import { betterAuth } from \"better-auth\";\nimport { hash, verify, type Options } from \"@node-rs\u002Fargon2\";\n\nconst argon2Options: Options = {\n  memoryCost: 65536, \u002F\u002F 64 MiB\n  timeCost: 3, \u002F\u002F 3 iterations\n  parallelism: 4, \u002F\u002F 4 parallel lanes\n  outputLen: 32, \u002F\u002F 32 byte output\n  algorithm: 2, \u002F\u002F Argon2id variant\n};\n\nexport const auth = betterAuth({\n  emailAndPassword: {\n    enabled: true,\n    password: {\n      hash: (password) => hash(password, argon2Options),\n      verify: ({ password, hash: storedHash }) =>\n        verify(storedHash, password, argon2Options),\n    },\n  },\n});\n",[2435],{"type":36,"tag":55,"props":2436,"children":2437},{"__ignoreMap":129},[2438,2477,2541,2548,2577,2603,2629,2655,2681,2707,2715,2722,2753,2768,2787,2803,2854,2902,2935,2942,2949],{"type":36,"tag":135,"props":2439,"children":2440},{"class":137,"line":138},[2441,2445,2449,2453,2457,2461,2465,2469,2473],{"type":36,"tag":135,"props":2442,"children":2443},{"style":142},[2444],{"type":42,"value":145},{"type":36,"tag":135,"props":2446,"children":2447},{"style":148},[2448],{"type":42,"value":151},{"type":36,"tag":135,"props":2450,"children":2451},{"style":154},[2452],{"type":42,"value":157},{"type":36,"tag":135,"props":2454,"children":2455},{"style":148},[2456],{"type":42,"value":162},{"type":36,"tag":135,"props":2458,"children":2459},{"style":142},[2460],{"type":42,"value":167},{"type":36,"tag":135,"props":2462,"children":2463},{"style":148},[2464],{"type":42,"value":172},{"type":36,"tag":135,"props":2466,"children":2467},{"style":175},[2468],{"type":42,"value":8},{"type":36,"tag":135,"props":2470,"children":2471},{"style":148},[2472],{"type":42,"value":182},{"type":36,"tag":135,"props":2474,"children":2475},{"style":148},[2476],{"type":42,"value":187},{"type":36,"tag":135,"props":2478,"children":2479},{"class":137,"line":190},[2480,2484,2488,2493,2497,2502,2506,2511,2516,2520,2524,2528,2533,2537],{"type":36,"tag":135,"props":2481,"children":2482},{"style":142},[2483],{"type":42,"value":145},{"type":36,"tag":135,"props":2485,"children":2486},{"style":148},[2487],{"type":42,"value":151},{"type":36,"tag":135,"props":2489,"children":2490},{"style":154},[2491],{"type":42,"value":2492}," hash",{"type":36,"tag":135,"props":2494,"children":2495},{"style":148},[2496],{"type":42,"value":340},{"type":36,"tag":135,"props":2498,"children":2499},{"style":154},[2500],{"type":42,"value":2501}," verify",{"type":36,"tag":135,"props":2503,"children":2504},{"style":148},[2505],{"type":42,"value":340},{"type":36,"tag":135,"props":2507,"children":2508},{"style":142},[2509],{"type":42,"value":2510}," type",{"type":36,"tag":135,"props":2512,"children":2513},{"style":154},[2514],{"type":42,"value":2515}," Options",{"type":36,"tag":135,"props":2517,"children":2518},{"style":148},[2519],{"type":42,"value":162},{"type":36,"tag":135,"props":2521,"children":2522},{"style":142},[2523],{"type":42,"value":167},{"type":36,"tag":135,"props":2525,"children":2526},{"style":148},[2527],{"type":42,"value":172},{"type":36,"tag":135,"props":2529,"children":2530},{"style":175},[2531],{"type":42,"value":2532},"@node-rs\u002Fargon2",{"type":36,"tag":135,"props":2534,"children":2535},{"style":148},[2536],{"type":42,"value":182},{"type":36,"tag":135,"props":2538,"children":2539},{"style":148},[2540],{"type":42,"value":187},{"type":36,"tag":135,"props":2542,"children":2543},{"class":137,"line":239},[2544],{"type":36,"tag":135,"props":2545,"children":2546},{"emptyLinePlaceholder":243},[2547],{"type":42,"value":246},{"type":36,"tag":135,"props":2549,"children":2550},{"class":137,"line":249},[2551,2555,2560,2564,2569,2573],{"type":36,"tag":135,"props":2552,"children":2553},{"style":258},[2554],{"type":42,"value":752},{"type":36,"tag":135,"props":2556,"children":2557},{"style":154},[2558],{"type":42,"value":2559}," argon2Options",{"type":36,"tag":135,"props":2561,"children":2562},{"style":148},[2563],{"type":42,"value":301},{"type":36,"tag":135,"props":2565,"children":2567},{"style":2566},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[2568],{"type":42,"value":2515},{"type":36,"tag":135,"props":2570,"children":2571},{"style":148},[2572],{"type":42,"value":779},{"type":36,"tag":135,"props":2574,"children":2575},{"style":148},[2576],{"type":42,"value":306},{"type":36,"tag":135,"props":2578,"children":2579},{"class":137,"line":289},[2580,2585,2589,2594,2598],{"type":36,"tag":135,"props":2581,"children":2582},{"style":293},[2583],{"type":42,"value":2584},"  memoryCost",{"type":36,"tag":135,"props":2586,"children":2587},{"style":148},[2588],{"type":42,"value":301},{"type":36,"tag":135,"props":2590,"children":2591},{"style":1705},[2592],{"type":42,"value":2593}," 65536",{"type":36,"tag":135,"props":2595,"children":2596},{"style":148},[2597],{"type":42,"value":340},{"type":36,"tag":135,"props":2599,"children":2600},{"style":233},[2601],{"type":42,"value":2602}," \u002F\u002F 64 MiB\n",{"type":36,"tag":135,"props":2604,"children":2605},{"class":137,"line":309},[2606,2611,2615,2620,2624],{"type":36,"tag":135,"props":2607,"children":2608},{"style":293},[2609],{"type":42,"value":2610},"  timeCost",{"type":36,"tag":135,"props":2612,"children":2613},{"style":148},[2614],{"type":42,"value":301},{"type":36,"tag":135,"props":2616,"children":2617},{"style":1705},[2618],{"type":42,"value":2619}," 3",{"type":36,"tag":135,"props":2621,"children":2622},{"style":148},[2623],{"type":42,"value":340},{"type":36,"tag":135,"props":2625,"children":2626},{"style":233},[2627],{"type":42,"value":2628}," \u002F\u002F 3 iterations\n",{"type":36,"tag":135,"props":2630,"children":2631},{"class":137,"line":381},[2632,2637,2641,2646,2650],{"type":36,"tag":135,"props":2633,"children":2634},{"style":293},[2635],{"type":42,"value":2636},"  parallelism",{"type":36,"tag":135,"props":2638,"children":2639},{"style":148},[2640],{"type":42,"value":301},{"type":36,"tag":135,"props":2642,"children":2643},{"style":1705},[2644],{"type":42,"value":2645}," 4",{"type":36,"tag":135,"props":2647,"children":2648},{"style":148},[2649],{"type":42,"value":340},{"type":36,"tag":135,"props":2651,"children":2652},{"style":233},[2653],{"type":42,"value":2654}," \u002F\u002F 4 parallel lanes\n",{"type":36,"tag":135,"props":2656,"children":2657},{"class":137,"line":402},[2658,2663,2667,2672,2676],{"type":36,"tag":135,"props":2659,"children":2660},{"style":293},[2661],{"type":42,"value":2662},"  outputLen",{"type":36,"tag":135,"props":2664,"children":2665},{"style":148},[2666],{"type":42,"value":301},{"type":36,"tag":135,"props":2668,"children":2669},{"style":1705},[2670],{"type":42,"value":2671}," 32",{"type":36,"tag":135,"props":2673,"children":2674},{"style":148},[2675],{"type":42,"value":340},{"type":36,"tag":135,"props":2677,"children":2678},{"style":233},[2679],{"type":42,"value":2680}," \u002F\u002F 32 byte output\n",{"type":36,"tag":135,"props":2682,"children":2683},{"class":137,"line":433},[2684,2689,2693,2698,2702],{"type":36,"tag":135,"props":2685,"children":2686},{"style":293},[2687],{"type":42,"value":2688},"  algorithm",{"type":36,"tag":135,"props":2690,"children":2691},{"style":148},[2692],{"type":42,"value":301},{"type":36,"tag":135,"props":2694,"children":2695},{"style":1705},[2696],{"type":42,"value":2697}," 2",{"type":36,"tag":135,"props":2699,"children":2700},{"style":148},[2701],{"type":42,"value":340},{"type":36,"tag":135,"props":2703,"children":2704},{"style":233},[2705],{"type":42,"value":2706}," \u002F\u002F Argon2id variant\n",{"type":36,"tag":135,"props":2708,"children":2709},{"class":137,"line":463},[2710],{"type":36,"tag":135,"props":2711,"children":2712},{"style":148},[2713],{"type":42,"value":2714},"};\n",{"type":36,"tag":135,"props":2716,"children":2717},{"class":137,"line":505},[2718],{"type":36,"tag":135,"props":2719,"children":2720},{"emptyLinePlaceholder":243},[2721],{"type":42,"value":246},{"type":36,"tag":135,"props":2723,"children":2724},{"class":137,"line":522},[2725,2729,2733,2737,2741,2745,2749],{"type":36,"tag":135,"props":2726,"children":2727},{"style":142},[2728],{"type":42,"value":255},{"type":36,"tag":135,"props":2730,"children":2731},{"style":258},[2732],{"type":42,"value":261},{"type":36,"tag":135,"props":2734,"children":2735},{"style":154},[2736],{"type":42,"value":266},{"type":36,"tag":135,"props":2738,"children":2739},{"style":148},[2740],{"type":42,"value":271},{"type":36,"tag":135,"props":2742,"children":2743},{"style":274},[2744],{"type":42,"value":157},{"type":36,"tag":135,"props":2746,"children":2747},{"style":154},[2748],{"type":42,"value":281},{"type":36,"tag":135,"props":2750,"children":2751},{"style":148},[2752],{"type":42,"value":286},{"type":36,"tag":135,"props":2754,"children":2755},{"class":137,"line":531},[2756,2760,2764],{"type":36,"tag":135,"props":2757,"children":2758},{"style":293},[2759],{"type":42,"value":646},{"type":36,"tag":135,"props":2761,"children":2762},{"style":148},[2763],{"type":42,"value":301},{"type":36,"tag":135,"props":2765,"children":2766},{"style":148},[2767],{"type":42,"value":306},{"type":36,"tag":135,"props":2769,"children":2770},{"class":137,"line":540},[2771,2775,2779,2783],{"type":36,"tag":135,"props":2772,"children":2773},{"style":293},[2774],{"type":42,"value":1031},{"type":36,"tag":135,"props":2776,"children":2777},{"style":148},[2778],{"type":42,"value":301},{"type":36,"tag":135,"props":2780,"children":2781},{"style":669},[2782],{"type":42,"value":672},{"type":36,"tag":135,"props":2784,"children":2785},{"style":148},[2786],{"type":42,"value":430},{"type":36,"tag":135,"props":2788,"children":2789},{"class":137,"line":1247},[2790,2795,2799],{"type":36,"tag":135,"props":2791,"children":2792},{"style":293},[2793],{"type":42,"value":2794},"    password",{"type":36,"tag":135,"props":2796,"children":2797},{"style":148},[2798],{"type":42,"value":301},{"type":36,"tag":135,"props":2800,"children":2801},{"style":148},[2802],{"type":42,"value":306},{"type":36,"tag":135,"props":2804,"children":2805},{"class":137,"line":1256},[2806,2811,2815,2819,2824,2828,2832,2836,2841,2845,2850],{"type":36,"tag":135,"props":2807,"children":2808},{"style":274},[2809],{"type":42,"value":2810},"      hash",{"type":36,"tag":135,"props":2812,"children":2813},{"style":148},[2814],{"type":42,"value":301},{"type":36,"tag":135,"props":2816,"children":2817},{"style":148},[2818],{"type":42,"value":1512},{"type":36,"tag":135,"props":2820,"children":2821},{"style":332},[2822],{"type":42,"value":2823},"password",{"type":36,"tag":135,"props":2825,"children":2826},{"style":148},[2827],{"type":42,"value":369},{"type":36,"tag":135,"props":2829,"children":2830},{"style":258},[2831],{"type":42,"value":374},{"type":36,"tag":135,"props":2833,"children":2834},{"style":274},[2835],{"type":42,"value":2492},{"type":36,"tag":135,"props":2837,"children":2838},{"style":154},[2839],{"type":42,"value":2840},"(password",{"type":36,"tag":135,"props":2842,"children":2843},{"style":148},[2844],{"type":42,"value":340},{"type":36,"tag":135,"props":2846,"children":2847},{"style":154},[2848],{"type":42,"value":2849}," argon2Options)",{"type":36,"tag":135,"props":2851,"children":2852},{"style":148},[2853],{"type":42,"value":430},{"type":36,"tag":135,"props":2855,"children":2856},{"class":137,"line":1301},[2857,2862,2866,2870,2875,2879,2883,2887,2892,2897],{"type":36,"tag":135,"props":2858,"children":2859},{"style":274},[2860],{"type":42,"value":2861},"      verify",{"type":36,"tag":135,"props":2863,"children":2864},{"style":148},[2865],{"type":42,"value":301},{"type":36,"tag":135,"props":2867,"children":2868},{"style":148},[2869],{"type":42,"value":329},{"type":36,"tag":135,"props":2871,"children":2872},{"style":332},[2873],{"type":42,"value":2874}," password",{"type":36,"tag":135,"props":2876,"children":2877},{"style":148},[2878],{"type":42,"value":340},{"type":36,"tag":135,"props":2880,"children":2881},{"style":293},[2882],{"type":42,"value":2492},{"type":36,"tag":135,"props":2884,"children":2885},{"style":148},[2886],{"type":42,"value":301},{"type":36,"tag":135,"props":2888,"children":2889},{"style":332},[2890],{"type":42,"value":2891}," storedHash",{"type":36,"tag":135,"props":2893,"children":2894},{"style":148},[2895],{"type":42,"value":2896}," })",{"type":36,"tag":135,"props":2898,"children":2899},{"style":258},[2900],{"type":42,"value":2901}," =>\n",{"type":36,"tag":135,"props":2903,"children":2904},{"class":137,"line":1310},[2905,2910,2915,2919,2923,2927,2931],{"type":36,"tag":135,"props":2906,"children":2907},{"style":274},[2908],{"type":42,"value":2909},"        verify",{"type":36,"tag":135,"props":2911,"children":2912},{"style":154},[2913],{"type":42,"value":2914},"(storedHash",{"type":36,"tag":135,"props":2916,"children":2917},{"style":148},[2918],{"type":42,"value":340},{"type":36,"tag":135,"props":2920,"children":2921},{"style":154},[2922],{"type":42,"value":2874},{"type":36,"tag":135,"props":2924,"children":2925},{"style":148},[2926],{"type":42,"value":340},{"type":36,"tag":135,"props":2928,"children":2929},{"style":154},[2930],{"type":42,"value":2849},{"type":36,"tag":135,"props":2932,"children":2933},{"style":148},[2934],{"type":42,"value":430},{"type":36,"tag":135,"props":2936,"children":2937},{"class":137,"line":1380},[2938],{"type":36,"tag":135,"props":2939,"children":2940},{"style":148},[2941],{"type":42,"value":528},{"type":36,"tag":135,"props":2943,"children":2944},{"class":137,"line":1388},[2945],{"type":36,"tag":135,"props":2946,"children":2947},{"style":148},[2948],{"type":42,"value":537},{"type":36,"tag":135,"props":2950,"children":2951},{"class":137,"line":1396},[2952,2956,2960],{"type":36,"tag":135,"props":2953,"children":2954},{"style":148},[2955],{"type":42,"value":546},{"type":36,"tag":135,"props":2957,"children":2958},{"style":154},[2959],{"type":42,"value":369},{"type":36,"tag":135,"props":2961,"children":2962},{"style":148},[2963],{"type":42,"value":187},{"type":36,"tag":112,"props":2965,"children":2966},{},[2967,2971],{"type":36,"tag":559,"props":2968,"children":2969},{},[2970],{"type":42,"value":563},{"type":42,"value":2972},": If you switch hashing algorithms on an existing system, users with passwords hashed using the old algorithm won't be able to sign in. Plan a migration strategy if needed.",{"type":36,"tag":2974,"props":2975,"children":2976},"style",{},[2977],{"type":42,"value":2978},"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":2980,"total":309},[2981,2996,3011,3024,3030,3045],{"slug":2982,"name":2982,"fn":2983,"description":2984,"org":2985,"tags":2986,"stars":20,"repoUrl":21,"updatedAt":2995},"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},[2987,2988,2989,2992],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":2990,"slug":2991,"type":13},"Sessions","sessions",{"name":2993,"slug":2994,"type":13},"TypeScript","typescript","2026-04-06T18:05:01.910941",{"slug":2997,"name":2997,"fn":2998,"description":2999,"org":3000,"tags":3001,"stars":20,"repoUrl":21,"updatedAt":3010},"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},[3002,3005,3006,3007],{"name":3003,"slug":3004,"type":13},"Audit","audit",{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":3008,"slug":3009,"type":13},"Security","security","2026-07-11T05:40:04.318478",{"slug":3012,"name":3012,"fn":3013,"description":3014,"org":3015,"tags":3016,"stars":20,"repoUrl":21,"updatedAt":3023},"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},[3017,3018,3019,3022],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":3020,"slug":3021,"type":13},"OAuth","oauth",{"name":2993,"slug":2994,"type":13},"2026-04-06T18:04:59.364175",{"slug":4,"name":4,"fn":5,"description":6,"org":3025,"tags":3026,"stars":20,"repoUrl":21,"updatedAt":22},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3027,3028,3029],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":18,"slug":19,"type":13},{"slug":3031,"name":3031,"fn":3032,"description":3033,"org":3034,"tags":3035,"stars":20,"repoUrl":21,"updatedAt":3044},"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},[3036,3037,3038,3041],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":3039,"slug":3040,"type":13},"Multi-Tenant","multi-tenant",{"name":3042,"slug":3043,"type":13},"RBAC","rbac","2026-04-06T18:05:00.636075",{"slug":3046,"name":3046,"fn":3047,"description":3048,"org":3049,"tags":3050,"stars":20,"repoUrl":21,"updatedAt":3059},"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},[3051,3054,3055,3056],{"name":3052,"slug":3053,"type":13},"2FA","two-factor-auth",{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":3057,"slug":3058,"type":13},"MFA","mfa","2026-04-06T18:04:58.118682",{"items":3061,"total":309},[3062,3069,3076,3083,3089,3096],{"slug":2982,"name":2982,"fn":2983,"description":2984,"org":3063,"tags":3064,"stars":20,"repoUrl":21,"updatedAt":2995},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3065,3066,3067,3068],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":2990,"slug":2991,"type":13},{"name":2993,"slug":2994,"type":13},{"slug":2997,"name":2997,"fn":2998,"description":2999,"org":3070,"tags":3071,"stars":20,"repoUrl":21,"updatedAt":3010},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3072,3073,3074,3075],{"name":3003,"slug":3004,"type":13},{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":3008,"slug":3009,"type":13},{"slug":3012,"name":3012,"fn":3013,"description":3014,"org":3077,"tags":3078,"stars":20,"repoUrl":21,"updatedAt":3023},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3079,3080,3081,3082],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":3020,"slug":3021,"type":13},{"name":2993,"slug":2994,"type":13},{"slug":4,"name":4,"fn":5,"description":6,"org":3084,"tags":3085,"stars":20,"repoUrl":21,"updatedAt":22},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3086,3087,3088],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":18,"slug":19,"type":13},{"slug":3031,"name":3031,"fn":3032,"description":3033,"org":3090,"tags":3091,"stars":20,"repoUrl":21,"updatedAt":3044},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3092,3093,3094,3095],{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":3039,"slug":3040,"type":13},{"name":3042,"slug":3043,"type":13},{"slug":3046,"name":3046,"fn":3047,"description":3048,"org":3097,"tags":3098,"stars":20,"repoUrl":21,"updatedAt":3059},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3099,3100,3101,3102],{"name":3052,"slug":3053,"type":13},{"name":15,"slug":16,"type":13},{"name":9,"slug":8,"type":13},{"name":3057,"slug":3058,"type":13}]