[{"data":1,"prerenderedAt":823},["ShallowReactive",2],{"navigation":3,"\u002Fsign-in\u002Fmethods":178,"\u002Fsign-in\u002Fmethods-surround":818},[4,23,78,95,123,143,158],{"title":5,"path":6,"stem":7,"children":8,"icon":22},"Getting Started","\u002Fgetting-started","1.getting-started\u002F1.index",[9,12,17],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-house",{"title":13,"path":14,"stem":15,"icon":16},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":18,"path":19,"stem":20,"icon":21},"Configuration","\u002Fgetting-started\u002Fconfiguration","1.getting-started\u002F3.configuration","i-lucide-settings",false,{"title":24,"icon":22,"path":25,"stem":26,"children":27,"page":22},"Sign-in","\u002Fsign-in","2.sign-in",[28,33,38,43,48,53,58,63,68,73],{"title":29,"path":30,"stem":31,"icon":32},"Sign-in pages","\u002Fsign-in\u002Fpages","2.sign-in\u002F1.pages","i-lucide-log-in",{"title":34,"path":35,"stem":36,"icon":37},"Several accounts","\u002Fsign-in\u002Fmulti-session","2.sign-in\u002F10.multi-session","i-lucide-users-round",{"title":39,"path":40,"stem":41,"icon":42},"Account page","\u002Fsign-in\u002Faccount","2.sign-in\u002F2.account","i-lucide-circle-user",{"title":44,"path":45,"stem":46,"icon":47},"Other methods","\u002Fsign-in\u002Fmethods","2.sign-in\u002F3.methods","i-lucide-key-square",{"title":49,"path":50,"stem":51,"icon":52},"Sign-in providers","\u002Fsign-in\u002Fproviders","2.sign-in\u002F4.providers","i-lucide-share-2",{"title":54,"path":55,"stem":56,"icon":57},"Two-factor","\u002Fsign-in\u002Ftwo-factor","2.sign-in\u002F5.two-factor","i-lucide-shield-check",{"title":59,"path":60,"stem":61,"icon":62},"Passkeys","\u002Fsign-in\u002Fpasskeys","2.sign-in\u002F6.passkeys","i-lucide-fingerprint",{"title":64,"path":65,"stem":66,"icon":67},"Phone numbers","\u002Fsign-in\u002Fphone-numbers","2.sign-in\u002F7.phone-numbers","i-lucide-smartphone",{"title":69,"path":70,"stem":71,"icon":72},"Signing in devices","\u002Fsign-in\u002Fdevices","2.sign-in\u002F8.devices","i-lucide-tv",{"title":74,"path":75,"stem":76,"icon":77},"Security","\u002Fsign-in\u002Fsecurity","2.sign-in\u002F9.security","i-lucide-lock-keyhole",{"title":79,"path":80,"stem":81,"children":82,"icon":22},"Organizations","\u002Forganizations","3.organizations\u002F1.index",[83,85,90],{"title":79,"path":80,"stem":81,"icon":84},"i-lucide-building-2",{"title":86,"path":87,"stem":88,"icon":89},"Roles","\u002Forganizations\u002Froles","3.organizations\u002F2.roles","i-lucide-shield",{"title":91,"path":92,"stem":93,"icon":94},"Single sign-on","\u002Forganizations\u002Fsso","3.organizations\u002F3.sso","i-lucide-key-round",{"title":96,"path":97,"stem":98,"children":99,"icon":22},"Admin dashboard","\u002Fadmin","4.admin\u002F1.index",[100,103,108,113,118],{"title":101,"path":97,"stem":98,"icon":102},"Overview","i-lucide-layout-dashboard",{"title":104,"path":105,"stem":106,"icon":107},"Managing users","\u002Fadmin\u002Fusers","4.admin\u002F2.users","i-lucide-user-cog",{"title":109,"path":110,"stem":111,"icon":112},"Staff roles","\u002Fadmin\u002Froles","4.admin\u002F3.roles","i-lucide-shield-user",{"title":114,"path":115,"stem":116,"icon":117},"Audit log","\u002Fadmin\u002Faudit-log","4.admin\u002F4.audit-log","i-lucide-history",{"title":119,"path":120,"stem":121,"icon":122},"Your own pages","\u002Fadmin\u002Fextending","4.admin\u002F5.extending","i-lucide-layout-panel-left",{"title":124,"icon":22,"path":125,"stem":126,"children":127,"page":22},"Integrations","\u002Fintegrations","5.integrations",[128,133,138],{"title":129,"path":130,"stem":131,"icon":132},"Stripe","\u002Fintegrations\u002Fstripe","5.integrations\u002F1.stripe","i-simple-icons-stripe",{"title":134,"path":135,"stem":136,"icon":137},"API keys","\u002Fintegrations\u002Fapi-keys","5.integrations\u002F2.api-keys","i-lucide-key",{"title":139,"path":140,"stem":141,"icon":142},"Tokens","\u002Fintegrations\u002Ftokens","5.integrations\u002F3.tokens","i-lucide-ticket",{"title":144,"icon":22,"path":145,"stem":146,"children":147,"page":22},"Customization","\u002Fcustomization","6.customization",[148,153],{"title":149,"path":150,"stem":151,"icon":152},"Emails","\u002Fcustomization\u002Femails","6.customization\u002F1.emails","i-lucide-mail",{"title":154,"path":155,"stem":156,"icon":157},"Languages","\u002Fcustomization\u002Flanguages","6.customization\u002F2.languages","i-lucide-languages",{"title":159,"icon":22,"path":160,"stem":161,"children":162,"page":22},"Reference","\u002Freference","7.reference",[163,168,173],{"title":164,"path":165,"stem":166,"icon":167},"How it works","\u002Freference\u002Fhow-it-works","7.reference\u002F1.how-it-works","i-lucide-cog",{"title":169,"path":170,"stem":171,"icon":172},"API reference","\u002Freference\u002Fapi","7.reference\u002F2.api","i-lucide-braces",{"title":174,"path":175,"stem":176,"icon":177},"Contributing","\u002Freference\u002Fcontributing","7.reference\u002F3.contributing","i-lucide-git-pull-request",{"id":179,"title":180,"body":181,"description":811,"extension":812,"links":813,"meta":814,"navigation":815,"path":45,"seo":816,"stem":46,"__hash__":817},"docs\u002F2.sign-in\u002F3.methods.md","Usernames, links and codes",{"type":182,"value":183,"toc":803},"minimark",[184,188,329,342,347,357,417,440,453,457,465,489,505,512,516,524,545,572,582,588,592,600,625,630,639,767,790,799],[185,186,187],"p",{},"Each of these is one of Better Auth's own plugins. They're all off by default; turn on the ones you want and the\nsign-in pages show them.",[189,190,196],"pre",{"className":191,"code":192,"filename":193,"language":194,"meta":195,"style":195},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export default defineNuxtConfig({\n  betterAuthUi: {\n    username: { enabled: true },\n    magicLink: { enabled: true },\n    emailOtp: { enabled: true },\n    anonymous: { enabled: true }\n  }\n})\n","nuxt.config.ts","ts","",[197,198,199,223,236,259,277,295,314,320],"code",{"__ignoreMap":195},[200,201,204,208,211,215,219],"span",{"class":202,"line":203},"line",1,[200,205,207],{"class":206},"s7zQu","export",[200,209,210],{"class":206}," default",[200,212,214],{"class":213},"s2Zo4"," defineNuxtConfig",[200,216,218],{"class":217},"sTEyZ","(",[200,220,222],{"class":221},"sMK4o","{\n",[200,224,226,230,233],{"class":202,"line":225},2,[200,227,229],{"class":228},"swJcz","  betterAuthUi",[200,231,232],{"class":221},":",[200,234,235],{"class":221}," {\n",[200,237,239,242,244,247,250,252,256],{"class":202,"line":238},3,[200,240,241],{"class":228},"    username",[200,243,232],{"class":221},[200,245,246],{"class":221}," {",[200,248,249],{"class":228}," enabled",[200,251,232],{"class":221},[200,253,255],{"class":254},"sfNiH"," true",[200,257,258],{"class":221}," },\n",[200,260,262,265,267,269,271,273,275],{"class":202,"line":261},4,[200,263,264],{"class":228},"    magicLink",[200,266,232],{"class":221},[200,268,246],{"class":221},[200,270,249],{"class":228},[200,272,232],{"class":221},[200,274,255],{"class":254},[200,276,258],{"class":221},[200,278,280,283,285,287,289,291,293],{"class":202,"line":279},5,[200,281,282],{"class":228},"    emailOtp",[200,284,232],{"class":221},[200,286,246],{"class":221},[200,288,249],{"class":228},[200,290,232],{"class":221},[200,292,255],{"class":254},[200,294,258],{"class":221},[200,296,298,301,303,305,307,309,311],{"class":202,"line":297},6,[200,299,300],{"class":228},"    anonymous",[200,302,232],{"class":221},[200,304,246],{"class":221},[200,306,249],{"class":228},[200,308,232],{"class":221},[200,310,255],{"class":254},[200,312,313],{"class":221}," }\n",[200,315,317],{"class":202,"line":316},7,[200,318,319],{"class":221},"  }\n",[200,321,323,326],{"class":202,"line":322},8,[200,324,325],{"class":221},"}",[200,327,328],{"class":217},")\n",[330,331,332],"tip",{},[185,333,334,335,341],{},"Sign-in links and codes by email are sent through the module's emails, so set\n",[336,337,338],"a",{"href":150},[197,339,340],{},"emails.send"," first.",[343,344,346],"h2",{"id":345},"usernames","Usernames",[185,348,349,350,356],{},"Better Auth's ",[336,351,355],{"href":352,"rel":353},"https:\u002F\u002Fbetter-auth.com\u002Fdocs\u002Fplugins\u002Fusername",[354],"nofollow","Username plugin",".",[358,359,360,375,385,398,407],"ul",{},[361,362,363,367,368,371,372,374],"li",{},[364,365,366],"strong",{},"Sign up"," asks for a username: letters, numbers, ",[197,369,370],{},"_"," and ",[197,373,356],{},", as Better Auth checks them.",[361,376,377,380,381,384],{},[364,378,379],{},"Sign in"," takes \"Email or username\": anything with an ",[197,382,383],{},"@"," signs in by email, anything else by username.",[361,386,387,390,391,371,394,397],{},[364,388,389],{},"Usernames are case-insensitive",": ",[197,392,393],{},"Pixel_42",[197,395,396],{},"pixel_42"," are the same account. They're shown as typed.",[361,399,400,403,404,356],{},[364,401,402],{},"The account page"," lets people change it, unless it's ",[197,405,406],{},"immutable",[361,408,409,412,413,416],{},[364,410,411],{},"The admin"," shows it as ",[197,414,415],{},"@handle"," on the users list and each user's page.",[418,419,420,426,431,435],"field-group",{},[421,422],"field",{"name":423,"type":424,"default":425},"enabled","boolean","false",[421,427],{"name":428,"type":429,"default":430},"minLength","number","3",[421,432],{"name":433,"type":429,"default":434},"maxLength","30",[421,436,437],{"name":406,"type":424,"default":425},[185,438,439],{},"A username can be set once, then not changed.",[441,442,443],"note",{},[185,444,445,446,371,449,452],{},"Adds ",[197,447,448],{},"username",[197,450,451],{},"displayUsername"," columns to the user table: run Better Auth's migrations.",[343,454,456],{"id":455},"sign-in-links","Sign-in links",[185,458,349,459,464],{},[336,460,463],{"href":461,"rel":462},"https:\u002F\u002Fbetter-auth.com\u002Fdocs\u002Fplugins\u002Fmagic-link",[354],"Magic Link plugin",". \"Email me a sign-in link\" on the\nsign-in page asks for an email and sends a link that works once.",[358,466,467,477,483],{},[361,468,469,472,473,476],{},[364,470,471],{},"A new email gets an account"," with the first link (unless ",[197,474,475],{},"disableSignUp","), and lands on the account page.",[361,478,479,482],{},[364,480,481],{},"An expired or used link"," comes back to the sign-in page with a message.",[361,484,485,488],{},[364,486,487],{},"Users with two-factor on"," are asked for their code after the link, as after a password.",[418,490,491,493,500],{},[421,492],{"name":423,"type":424,"default":425},[421,494,497],{"name":495,"type":429,"default":496},"expiresIn","300",[185,498,499],{},"Seconds a link lasts.",[421,501,502],{"name":475,"type":424,"default":425},[185,503,504],{},"Links only sign existing users in.",[185,506,507,508,511],{},"The email's template is ",[197,509,510],{},"magic-link",". No migration needed.",[343,513,515],{"id":514},"codes-by-email","Codes by email",[185,517,349,518,523],{},[336,519,522],{"href":520,"rel":521},"https:\u002F\u002Fbetter-auth.com\u002Fdocs\u002Fplugins\u002Femail-otp",[354],"Email OTP plugin",". \"Email me a code\" sends a 6-digit\ncode to type in on the same page. It's handy for signing in on a device that doesn't have the email: a TV, a console,\na shared computer.",[358,525,526,532,540],{},[361,527,528,531],{},[364,529,530],{},"Codes expire"," in 5 minutes and stop working after 3 wrong tries.",[361,533,534,536,537,539],{},[364,535,471],{}," (unless ",[197,538,475],{},").",[361,541,542,544],{},[364,543,487],{}," are asked for their two-factor code next.",[418,546,547,549,556,561,567],{},[421,548],{"name":423,"type":424,"default":425},[421,550,553],{"name":551,"type":429,"default":552},"otpLength","6",[185,554,555],{},"Digits in a code.",[421,557,558],{"name":495,"type":429,"default":496},[185,559,560],{},"Seconds a code lasts.",[421,562,564],{"name":563,"type":429,"default":430},"allowedAttempts",[185,565,566],{},"Wrong tries before a code stops working.",[421,568,569],{"name":475,"type":424,"default":425},[185,570,571],{},"Codes only sign existing users in.",[573,574,575],"warning",{},[185,576,577,578,581],{},"As Better Auth documents, signing in with a code to an account whose email was ",[364,579,580],{},"never verified"," removes that\naccount's password and signs out its sessions. The code proved who owns the email; the password didn't.",[185,583,507,584,587],{},[197,585,586],{},"email-code",". Better Auth's other code endpoints (verifying an email, resetting a password)\nwork too, and their emails are worded to match, but the pages only use sign-in codes. No migration needed.",[343,589,591],{"id":590},"guest-accounts","Guest accounts",[185,593,349,594,599],{},[336,595,598],{"href":596,"rel":597},"https:\u002F\u002Fbetter-auth.com\u002Fdocs\u002Fplugins\u002Fanonymous",[354],"Anonymous plugin",". \"Continue as a guest\" starts a real\naccount with no email or password, so people can use your app straight away.",[358,601,602,608,614,619],{},[361,603,604,607],{},[364,605,606],{},"Their account page"," says it's a guest account, with \"Create an account\", \"Sign in\" and \"Delete guest account\".\nEmail, password and security settings are hidden, and two-factor is never required of guests.",[361,609,610,613],{},[364,611,612],{},"Keeping the account:"," the sign-in and sign-up pages let guests in. Signing up, or signing in any way, moves them\nto that account, and Better Auth deletes the guest one.",[361,615,616,618],{},[364,617,411],{}," shows a \"Guest account\" badge, and a \"Guests\" filter on the users list.",[361,620,621,624],{},[364,622,623],{},"Security alerts"," are never sent to guests' generated addresses.",[626,627,629],"h3",{"id":628},"moving-a-guests-data","Moving a guest's data",[185,631,632,633,636,637,232],{},"Moving a guest's own data (a cart, saved items) to their new account is your app's job. Point ",[197,634,635],{},"onLinkAccount"," at a\nfile whose default export is Better Auth's ",[197,638,635],{},[640,641,642,719],"code-group",{},[189,643,645],{"className":191,"code":644,"filename":193,"language":194,"meta":195,"style":195},"export default defineNuxtConfig({\n  betterAuthUi: {\n    anonymous: {\n      enabled: true,\n      onLinkAccount: '.\u002Fserver\u002Fauth\u002Flink-guest.ts'\n    }\n  }\n})\n",[197,646,647,659,667,675,687,704,709,713],{"__ignoreMap":195},[200,648,649,651,653,655,657],{"class":202,"line":203},[200,650,207],{"class":206},[200,652,210],{"class":206},[200,654,214],{"class":213},[200,656,218],{"class":217},[200,658,222],{"class":221},[200,660,661,663,665],{"class":202,"line":225},[200,662,229],{"class":228},[200,664,232],{"class":221},[200,666,235],{"class":221},[200,668,669,671,673],{"class":202,"line":238},[200,670,300],{"class":228},[200,672,232],{"class":221},[200,674,235],{"class":221},[200,676,677,680,682,684],{"class":202,"line":261},[200,678,679],{"class":228},"      enabled",[200,681,232],{"class":221},[200,683,255],{"class":254},[200,685,686],{"class":221},",\n",[200,688,689,692,694,697,701],{"class":202,"line":279},[200,690,691],{"class":228},"      onLinkAccount",[200,693,232],{"class":221},[200,695,696],{"class":221}," '",[200,698,700],{"class":699},"sfazB",".\u002Fserver\u002Fauth\u002Flink-guest.ts",[200,702,703],{"class":221},"'\n",[200,705,706],{"class":202,"line":297},[200,707,708],{"class":221},"    }\n",[200,710,711],{"class":202,"line":316},[200,712,319],{"class":221},[200,714,715,717],{"class":202,"line":322},[200,716,325],{"class":221},[200,718,328],{"class":217},[189,720,723],{"className":191,"code":721,"filename":722,"language":194,"meta":195,"style":195},"export default async ({ anonymousUser, newUser }) => {\n  \u002F\u002F Move the guest's cart to their new account.\n}\n","server\u002Fauth\u002Flink-guest.ts",[197,724,725,756,762],{"__ignoreMap":195},[200,726,727,729,731,735,738,742,745,748,751,754],{"class":202,"line":203},[200,728,207],{"class":206},[200,730,210],{"class":206},[200,732,734],{"class":733},"spNyl"," async",[200,736,737],{"class":221}," ({",[200,739,741],{"class":740},"sHdIc"," anonymousUser",[200,743,744],{"class":221},",",[200,746,747],{"class":740}," newUser",[200,749,750],{"class":221}," })",[200,752,753],{"class":733}," =>",[200,755,235],{"class":221},[200,757,758],{"class":202,"line":225},[200,759,761],{"class":760},"sHwdD","  \u002F\u002F Move the guest's cart to their new account.\n",[200,763,764],{"class":202,"line":238},[200,765,766],{"class":221},"}\n",[418,768,769,771,777,784],{},[421,770],{"name":423,"type":424,"default":425},[421,772,774],{"name":635,"type":773},"string",[185,775,776],{},"A file whose default export moves a guest's data, relative to the project root. Nuxt aliases work too.",[421,778,781],{"name":779,"type":773,"default":780},"emailDomainName","'anonymous.placeholder.invalid'",[185,782,783],{},"The domain of guests' generated email addresses.",[421,785,787],{"name":786,"type":424,"default":425},"disableDeleteAnonymousUser",[185,788,789],{},"Guests can't delete their guest account, and it's kept when they link a real one.",[441,791,792],{},[185,793,794,795,798],{},"Adds an ",[197,796,797],{},"isAnonymous"," column to the user table: run Better Auth's migrations.",[800,801,802],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}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);}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}",{"title":195,"searchDepth":203,"depth":225,"links":804},[805,806,807,808],{"id":345,"depth":225,"text":346},{"id":455,"depth":225,"text":456},{"id":514,"depth":225,"text":515},{"id":590,"depth":225,"text":591,"children":809},[810],{"id":628,"depth":238,"text":629},"Usernames, sign-in links, codes by email, and guest accounts.","md",null,{},{"title":44,"icon":47},{"title":180,"description":811},"-EVdGTpz2calmqbUya7O1flN1Kg-3P5yN4m_VpgBuwE",[819,821],{"title":39,"path":40,"stem":41,"description":820,"icon":42,"children":-1},"Where people manage their own profile, security, devices and data.",{"title":49,"path":50,"stem":51,"description":822,"icon":52,"children":-1},"Google, GitHub, Discord and more, game platforms, and sign-in in a popup.",1793019844155]