[{"data":1,"prerenderedAt":923,"buildId":924},["ShallowReactive",2],{"docs-navigation-en":3,"example-\u002Fexamples\u002Fsidebase-nuxt-auth":50,"example-surround-\u002Fexamples\u002Fsidebase-nuxt-auth":751,"examples-en":760},[4],{"title":5,"path":6,"stem":7,"children":8,"page":49},"Docs","\u002Fdocs","docs",[9,13,17,21,25,29,33,37,41,45],{"title":10,"path":11,"stem":12},"Getting started","\u002Fdocs\u002Fgetting-started","docs\u002F01.getting-started",{"title":14,"path":15,"stem":16},"verifyUser","\u002Fdocs\u002Fverify-user","docs\u002F02.verify-user",{"title":18,"path":19,"stem":20},"Sites without users","\u002Fdocs\u002Fsites-without-users","docs\u002F03.sites-without-users",{"title":22,"path":23,"stem":24},"Build-time route check","\u002Fdocs\u002Froute-coverage","docs\u002F04.route-coverage",{"title":26,"path":27,"stem":28},"Public routes","\u002Fdocs\u002Fpublic-routes","docs\u002F05.public-routes",{"title":30,"path":31,"stem":32},"Same-origin writes","\u002Fdocs\u002Fsame-origin","docs\u002F06.same-origin",{"title":34,"path":35,"stem":36},"Scope and caching","\u002Fdocs\u002Fscope","docs\u002F07.scope",{"title":38,"path":39,"stem":40},"Configuration","\u002Fdocs\u002Fconfiguration","docs\u002F08.configuration",{"title":42,"path":43,"stem":44},"Migrating an existing BFF guard","\u002Fdocs\u002Fmigration","docs\u002F09.migration",{"title":46,"path":47,"stem":48},"Contributing","\u002Fdocs\u002Fcontributing","docs\u002F10.contributing",false,{"id":51,"title":52,"body":53,"category":740,"description":741,"extension":742,"meta":743,"navigation":173,"order":126,"path":744,"seo":745,"stem":746,"uses":747,"__hash__":750},"examples_en\u002Fexamples\u002Fsidebase-nuxt-auth.md","Auth.js with @sidebase\u002Fnuxt-auth",{"type":54,"value":55,"toc":737},"minimark",[56,80,348,353,368,700,707,733],[57,58,59,66,67,71,72,75,76,79],"p",{},[60,61,65],"a",{"href":62,"rel":63},"https:\u002F\u002Fauth.sidebase.io",[64],"nofollow","@sidebase\u002Fnuxt-auth"," wraps Auth.js (NextAuth). On the server, ",[68,69,70],"code",{},"getServerSession(event)"," from ",[68,73,74],{},"#auth"," returns the session or ",[68,77,78],{},"null",".",[81,82,88],"pre",{"className":83,"code":84,"filename":85,"language":86,"meta":87,"style":87},"language-ts shiki shiki-themes material-theme-lighter github-light github-dark","import { createError } from 'h3'\nimport type { VerifyUser } from '@kurashina-design\u002Fnuxt-bff-guard'\nimport { getServerSession } from '#auth'\n\nexport default (async (event) => {\n  \u002F\u002F null when nobody is signed in. Configuration errors throw 500 → the guard answers 503.\n  const session = await getServerSession(event)\n  if (!session?.user) throw createError({ statusCode: 401 })\n  event.context.user = session.user\n  return { viaBearer: false }\n}) satisfies VerifyUser\n","server\u002Fauth\u002Fverify-user.ts","ts","",[68,89,90,124,148,168,175,206,213,242,289,313,333],{"__ignoreMap":87},[91,92,95,99,103,107,110,113,117,121],"span",{"class":93,"line":94},"line",1,[91,96,98],{"class":97},"sVHd0","import",[91,100,102],{"class":101},"sP7_E"," {",[91,104,106],{"class":105},"su5hD"," createError",[91,108,109],{"class":101}," }",[91,111,112],{"class":97}," from",[91,114,116],{"class":115},"sjJ54"," '",[91,118,120],{"class":119},"s_sjI","h3",[91,122,123],{"class":115},"'\n",[91,125,127,129,132,134,137,139,141,143,146],{"class":93,"line":126},2,[91,128,98],{"class":97},[91,130,131],{"class":97}," type",[91,133,102],{"class":101},[91,135,136],{"class":105}," VerifyUser",[91,138,109],{"class":101},[91,140,112],{"class":97},[91,142,116],{"class":115},[91,144,145],{"class":119},"@kurashina-design\u002Fnuxt-bff-guard",[91,147,123],{"class":115},[91,149,151,153,155,158,160,162,164,166],{"class":93,"line":150},3,[91,152,98],{"class":97},[91,154,102],{"class":101},[91,156,157],{"class":105}," getServerSession",[91,159,109],{"class":101},[91,161,112],{"class":97},[91,163,116],{"class":115},[91,165,74],{"class":119},[91,167,123],{"class":115},[91,169,171],{"class":93,"line":170},4,[91,172,174],{"emptyLinePlaceholder":173},true,"\n",[91,176,178,181,184,187,191,193,197,200,203],{"class":93,"line":177},5,[91,179,180],{"class":97},"export",[91,182,183],{"class":97}," default",[91,185,186],{"class":105}," (",[91,188,190],{"class":189},"sbsja","async",[91,192,186],{"class":101},[91,194,196],{"class":195},"s99_P","event",[91,198,199],{"class":101},")",[91,201,202],{"class":189}," =>",[91,204,205],{"class":101}," {\n",[91,207,209],{"class":93,"line":208},6,[91,210,212],{"class":211},"sutJx","  \u002F\u002F null when nobody is signed in. Configuration errors throw 500 → the guard answers 503.\n",[91,214,216,219,223,227,230,233,237,239],{"class":93,"line":215},7,[91,217,218],{"class":189},"  const",[91,220,222],{"class":221},"s_hVV"," session",[91,224,226],{"class":225},"smGrS"," =",[91,228,229],{"class":97}," await",[91,231,157],{"class":232},"sGLFI",[91,234,236],{"class":235},"skxfh","(",[91,238,196],{"class":105},[91,240,241],{"class":235},")\n",[91,243,245,248,250,253,256,259,262,265,268,270,272,275,278,281,285,287],{"class":93,"line":244},8,[91,246,247],{"class":97},"  if",[91,249,186],{"class":235},[91,251,252],{"class":225},"!",[91,254,255],{"class":105},"session",[91,257,258],{"class":101},"?.",[91,260,261],{"class":105},"user",[91,263,264],{"class":235},") ",[91,266,267],{"class":97},"throw",[91,269,106],{"class":232},[91,271,236],{"class":235},[91,273,274],{"class":101},"{",[91,276,277],{"class":235}," statusCode",[91,279,280],{"class":101},":",[91,282,284],{"class":283},"srdBf"," 401",[91,286,109],{"class":101},[91,288,241],{"class":235},[91,290,292,295,297,300,302,304,306,308,310],{"class":93,"line":291},9,[91,293,294],{"class":105},"  event",[91,296,79],{"class":101},[91,298,299],{"class":105},"context",[91,301,79],{"class":101},[91,303,261],{"class":105},[91,305,226],{"class":225},[91,307,222],{"class":105},[91,309,79],{"class":101},[91,311,312],{"class":105},"user\n",[91,314,316,319,321,324,326,330],{"class":93,"line":315},10,[91,317,318],{"class":97},"  return",[91,320,102],{"class":101},[91,322,323],{"class":235}," viaBearer",[91,325,280],{"class":101},[91,327,329],{"class":328},"syTEX"," false",[91,331,332],{"class":101}," }\n",[91,334,336,339,341,344],{"class":93,"line":335},11,[91,337,338],{"class":101},"}",[91,340,264],{"class":105},[91,342,343],{"class":97},"satisfies",[91,345,347],{"class":346},"sbgvK"," VerifyUser\n",[349,350,352],"h2",{"id":351},"also-accepting-bearer-tokens","Also accepting Bearer tokens",[57,354,355,356,359,360,363,364,367],{},"With the JWT session strategy, ",[68,357,358],{},"getToken({ event })"," decodes the session token. It reads the session Cookie first and only falls back to ",[68,361,362],{},"Authorization: Bearer"," when there is no Cookie. Report ",[68,365,366],{},"viaBearer: true"," only in that case.",[81,369,371],{"className":83,"code":370,"filename":85,"language":86,"meta":87,"style":87},"import { createError, getHeader } from 'h3'\nimport type { VerifyUser } from '@kurashina-design\u002Fnuxt-bff-guard'\nimport { getToken } from '#auth'\n\nconst sessionCookies = ['next-auth.session-token', '__Secure-next-auth.session-token']\n\nexport default (async (event) => {\n  const token = await getToken({ event }) \u002F\u002F null when missing or invalid\n  if (!token?.sub) throw createError({ statusCode: 401 })\n\n  const cookieHeader = getHeader(event, 'cookie') ?? ''\n  \u002F\u002F Large sessions are split into chunks such as next-auth.session-token.0\n  const usedCookie = sessionCookies.some(name => cookieHeader.includes(name))\n  event.context.user = { id: token.sub }\n  return { viaBearer: !usedCookie }\n}) satisfies VerifyUser\n",[68,372,373,397,417,436,440,473,477,497,524,560,564,596,602,640,670,689],{"__ignoreMap":87},[91,374,375,377,379,381,384,387,389,391,393,395],{"class":93,"line":94},[91,376,98],{"class":97},[91,378,102],{"class":101},[91,380,106],{"class":105},[91,382,383],{"class":101},",",[91,385,386],{"class":105}," getHeader",[91,388,109],{"class":101},[91,390,112],{"class":97},[91,392,116],{"class":115},[91,394,120],{"class":119},[91,396,123],{"class":115},[91,398,399,401,403,405,407,409,411,413,415],{"class":93,"line":126},[91,400,98],{"class":97},[91,402,131],{"class":97},[91,404,102],{"class":101},[91,406,136],{"class":105},[91,408,109],{"class":101},[91,410,112],{"class":97},[91,412,116],{"class":115},[91,414,145],{"class":119},[91,416,123],{"class":115},[91,418,419,421,423,426,428,430,432,434],{"class":93,"line":150},[91,420,98],{"class":97},[91,422,102],{"class":101},[91,424,425],{"class":105}," getToken",[91,427,109],{"class":101},[91,429,112],{"class":97},[91,431,116],{"class":115},[91,433,74],{"class":119},[91,435,123],{"class":115},[91,437,438],{"class":93,"line":170},[91,439,174],{"emptyLinePlaceholder":173},[91,441,442,445,448,450,453,456,459,461,463,465,468,470],{"class":93,"line":177},[91,443,444],{"class":189},"const",[91,446,447],{"class":221}," sessionCookies",[91,449,226],{"class":225},[91,451,452],{"class":105}," [",[91,454,455],{"class":115},"'",[91,457,458],{"class":119},"next-auth.session-token",[91,460,455],{"class":115},[91,462,383],{"class":101},[91,464,116],{"class":115},[91,466,467],{"class":119},"__Secure-next-auth.session-token",[91,469,455],{"class":115},[91,471,472],{"class":105},"]\n",[91,474,475],{"class":93,"line":208},[91,476,174],{"emptyLinePlaceholder":173},[91,478,479,481,483,485,487,489,491,493,495],{"class":93,"line":215},[91,480,180],{"class":97},[91,482,183],{"class":97},[91,484,186],{"class":105},[91,486,190],{"class":189},[91,488,186],{"class":101},[91,490,196],{"class":195},[91,492,199],{"class":101},[91,494,202],{"class":189},[91,496,205],{"class":101},[91,498,499,501,504,506,508,510,512,514,517,519,521],{"class":93,"line":244},[91,500,218],{"class":189},[91,502,503],{"class":221}," token",[91,505,226],{"class":225},[91,507,229],{"class":97},[91,509,425],{"class":232},[91,511,236],{"class":235},[91,513,274],{"class":101},[91,515,516],{"class":105}," event",[91,518,109],{"class":101},[91,520,264],{"class":235},[91,522,523],{"class":211},"\u002F\u002F null when missing or invalid\n",[91,525,526,528,530,532,535,537,540,542,544,546,548,550,552,554,556,558],{"class":93,"line":291},[91,527,247],{"class":97},[91,529,186],{"class":235},[91,531,252],{"class":225},[91,533,534],{"class":105},"token",[91,536,258],{"class":101},[91,538,539],{"class":105},"sub",[91,541,264],{"class":235},[91,543,267],{"class":97},[91,545,106],{"class":232},[91,547,236],{"class":235},[91,549,274],{"class":101},[91,551,277],{"class":235},[91,553,280],{"class":101},[91,555,284],{"class":283},[91,557,109],{"class":101},[91,559,241],{"class":235},[91,561,562],{"class":93,"line":315},[91,563,174],{"emptyLinePlaceholder":173},[91,565,566,568,571,573,575,577,579,581,583,586,588,590,593],{"class":93,"line":335},[91,567,218],{"class":189},[91,569,570],{"class":221}," cookieHeader",[91,572,226],{"class":225},[91,574,386],{"class":232},[91,576,236],{"class":235},[91,578,196],{"class":105},[91,580,383],{"class":101},[91,582,116],{"class":115},[91,584,585],{"class":119},"cookie",[91,587,455],{"class":115},[91,589,264],{"class":235},[91,591,592],{"class":225},"??",[91,594,595],{"class":115}," ''\n",[91,597,599],{"class":93,"line":598},12,[91,600,601],{"class":211},"  \u002F\u002F Large sessions are split into chunks such as next-auth.session-token.0\n",[91,603,605,607,610,612,614,616,619,621,624,626,628,630,633,635,637],{"class":93,"line":604},13,[91,606,218],{"class":189},[91,608,609],{"class":221}," usedCookie",[91,611,226],{"class":225},[91,613,447],{"class":105},[91,615,79],{"class":101},[91,617,618],{"class":232},"some",[91,620,236],{"class":235},[91,622,623],{"class":195},"name",[91,625,202],{"class":189},[91,627,570],{"class":105},[91,629,79],{"class":101},[91,631,632],{"class":232},"includes",[91,634,236],{"class":235},[91,636,623],{"class":105},[91,638,639],{"class":235},"))\n",[91,641,643,645,647,649,651,653,655,657,660,662,664,666,668],{"class":93,"line":642},14,[91,644,294],{"class":105},[91,646,79],{"class":101},[91,648,299],{"class":105},[91,650,79],{"class":101},[91,652,261],{"class":105},[91,654,226],{"class":225},[91,656,102],{"class":101},[91,658,659],{"class":235}," id",[91,661,280],{"class":101},[91,663,503],{"class":105},[91,665,79],{"class":101},[91,667,539],{"class":105},[91,669,332],{"class":101},[91,671,673,675,677,679,681,684,687],{"class":93,"line":672},15,[91,674,318],{"class":97},[91,676,102],{"class":101},[91,678,323],{"class":235},[91,680,280],{"class":101},[91,682,683],{"class":225}," !",[91,685,686],{"class":105},"usedCookie",[91,688,332],{"class":101},[91,690,692,694,696,698],{"class":93,"line":691},16,[91,693,338],{"class":101},[91,695,264],{"class":105},[91,697,343],{"class":97},[91,699,347],{"class":346},[57,701,702,703,706],{},"The guard also checks the header shape itself, so ",[68,704,705],{},"viaBearer"," only takes effect when the request really carries a Bearer token.",[708,709,710],"note",{},[57,711,712,713,716,717,720,721,724,725,728,729,732],{},"The Auth.js endpoints (",[68,714,715],{},"\u002Fapi\u002Fauth\u002F*"," by default) are created by the module's ",[68,718,719],{},"NuxtAuthHandler",", which you write in ",[68,722,723],{},"server\u002Fapi\u002Fauth\u002F[...].ts",". Mark that one file public: ",[68,726,727],{},"export default defineBffHandler(NuxtAuthHandler({ ... }), { access: 'public' })",". Auth.js applies its own CSRF token to its POST endpoints. Providers that post their callback from their own site (",[68,730,731],{},"response_mode=form_post",", as Sign in with Apple does) are rejected by the same-origin check; use a redirect-based callback for them.",[734,735,736],"style",{},"html pre.shiki code .sVHd0, html code.shiki .sVHd0{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sbsja, html code.shiki .sbsja{--shiki-light:#9C3EDA;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .s99_P, html code.shiki .s99_P{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#E36209;--shiki-default-font-style:inherit;--shiki-dark:#FFAB70;--shiki-dark-font-style:inherit}html pre.shiki code .sutJx, html code.shiki .sutJx{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#6A737D;--shiki-dark-font-style:inherit}html pre.shiki code .s_hVV, html code.shiki .s_hVV{--shiki-light:#90A4AE;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sGLFI, html code.shiki .sGLFI{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .skxfh, html code.shiki .skxfh{--shiki-light:#E53935;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .syTEX, html code.shiki .syTEX{--shiki-light:#FF5370;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sbgvK, html code.shiki .sbgvK{--shiki-light:#E2931D;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":87,"searchDepth":126,"depth":126,"links":738},[739],{"id":351,"depth":126,"text":352},"auth","Check the Auth.js session, and accept the same JWT as a Bearer token.","md",{},"\u002Fexamples\u002Fsidebase-nuxt-auth",{"title":52,"description":741},"examples\u002Fsidebase-nuxt-auth",[65,748,749],"getServerSession","getToken","vOj0QRwuIx2jSTkmaLRjkxYBiQfsiWVwMVapC-DLglg",[752,756],{"path":753,"title":754,"description":755,"category":740,"order":94},"\u002Fexamples\u002Fnuxt-auth-utils","nuxt-auth-utils","Use the sealed Cookie session of nuxt-auth-utils as the user check.",{"path":757,"title":758,"description":759,"category":740,"order":150},"\u002Fexamples\u002Fsupabase","Supabase","Verify the Supabase session with getClaims, and tell bad tokens from outages.",[761,770,777,784,789,792,794,799,806,814,822,829,837,844,850,856,864,870,878,884,892,898,904,909,916],{"path":762,"title":763,"description":764,"category":765,"order":94,"uses":766},"\u002Fexamples\u002Fcontact-form","Contact form on a corporate site","A mail-sending route that only your own pages can call, with a bot check and a rate limit.","visitor",[767,768,769],"access: 'visitor'","@nuxtjs\u002Fturnstile","nuxt-security",{"path":771,"title":772,"description":773,"category":765,"order":126,"uses":774},"\u002Fexamples\u002Fpaid-api-proxy","Search box that calls a paid API","Keep other sites and scripts from spending your API quota through your BFF.",[767,775,776],"rateLimiter","defineCachedFunction",{"path":778,"title":779,"description":780,"category":765,"order":150,"uses":781},"\u002Fexamples\u002Fclient-data","JSON for client-side pages","Data that your pages fetch in the browser, kept from being embedded by other sites.",[767,782,783],"access: 'public'","useFetch",{"path":785,"title":786,"description":787,"category":765,"order":170,"uses":788},"\u002Fexamples\u002Fmember-site-contact","Visitor routes inside a member app","Keep 'user' as the default and open a few routes to visitors without accounts.",[767,14],{"path":753,"title":754,"description":755,"category":740,"order":94,"uses":790},[754,791],"requireUserSession",{"path":744,"title":52,"description":741,"category":740,"order":126,"uses":793},[65,748,749],{"path":757,"title":758,"description":759,"category":740,"order":150,"uses":795},[796,797,798],"@nuxtjs\u002Fsupabase","getClaims","isAuthRetryableFetchError",{"path":800,"title":801,"description":802,"category":740,"order":170,"uses":803},"\u002Fexamples\u002Fclerk","Clerk","Read the auth object that Clerk's middleware put on the event.",[804,805],"@clerk\u002Fnuxt","event.context.auth",{"path":807,"title":808,"description":809,"category":740,"order":177,"uses":810},"\u002Fexamples\u002Ffirebase","Firebase Authentication","Session Cookies for the browser, ID tokens for apps, and error codes mapped to 401 or 503.",[811,812,813],"firebase-admin","verifySessionCookie","verifyIdToken",{"path":815,"title":816,"description":817,"category":740,"order":208,"uses":818},"\u002Fexamples\u002Fjwt-jose","Any OpenID Connect provider (JWT)","Verify access tokens from Auth0, Keycloak, Cognito, Entra ID and others with jose.",[819,820,821],"jose","jwtVerify","createRemoteJWKSet",{"path":823,"title":824,"description":825,"category":826,"order":94,"uses":827},"\u002Fexamples\u002Fnuxt-security-rate-limit","Rate limits with nuxt-security","Slow down credential stuffing and token guessing before verifyUser runs.","security",[769,775,828],"routeRules",{"path":830,"title":831,"description":832,"category":826,"order":126,"uses":833},"\u002Fexamples\u002Fnuxt-security-headers","Headers, CSP and request limits with nuxt-security","A baseline nuxt-security setup next to the guard, tuned for a BFF.",[769,834,835,836],"headers","requestSizeLimiter","allowedMethodsRestricter",{"path":838,"title":839,"description":840,"category":826,"order":150,"uses":841},"\u002Fexamples\u002Fnuxt-csurf","CSRF tokens with nuxt-csurf","Add a synchronizer token on top of the origin check, without breaking Bearer clients.",[842,843,828],"nuxt-csurf","useCsrfFetch",{"path":845,"title":846,"description":847,"category":826,"order":170,"uses":848},"\u002Fexamples\u002Fturnstile","Bot checks on public routes with Turnstile","Public sign-in and sign-up routes skip verifyUser, so give them their own check.",[768,849],"verifyTurnstileToken",{"path":851,"title":852,"description":853,"category":826,"order":177,"uses":854},"\u002Fexamples\u002Fcors-bearer-clients","A frontend on another origin","CORS with nuxt-security for a separate app that calls the BFF with Bearer tokens.",[769,855,705],"corsHandler",{"path":857,"title":858,"description":859,"category":860,"order":94,"uses":861},"\u002Fexamples\u002Frecord-authorization","Per-record authorization","The guard says who the user is. The handler decides what they may touch.","patterns",[862,863],"event.context","createError",{"path":865,"title":866,"description":867,"category":860,"order":126,"uses":868},"\u002Fexamples\u002Froles","Roles and app-wide access","Reject whole groups of users in verifyUser, and check roles per route.",[14,869],"403",{"path":871,"title":872,"description":873,"category":860,"order":150,"uses":874},"\u002Fexamples\u002Fupstream-proxy","Calling an upstream API","Attach the user's token after the guard, never in middleware or routeRules.proxy.",[875,876,877],"$fetch","routeRules.proxy","server\u002Futils",{"path":879,"title":880,"description":881,"category":860,"order":170,"uses":882},"\u002Fexamples\u002Fssr-and-server-functions","SSR and server functions","Call your own API during server rendering, or skip HTTP entirely.",[783,883,877],"useRequestFetch",{"path":885,"title":886,"description":887,"category":860,"order":177,"uses":888},"\u002Fexamples\u002Fwebhooks","Webhooks","Server-to-server callbacks belong outside server\u002Fapi, with their own signature check.",[889,890,891],"server\u002Froutes","readRawBody","xssValidator",{"path":893,"title":894,"description":895,"category":860,"order":208,"uses":896},"\u002Fexamples\u002Fbearer-clients","Mobile apps and CLI tools","One BFF for the browser and for clients that send Bearer tokens.",[705,897],"Authorization",{"path":899,"title":900,"description":901,"category":860,"order":215,"uses":902},"\u002Fexamples\u002Fmore-route-folders","Checking more folders at build time","Extend routePatterns to server\u002Froutes and layers.",[903],"routePatterns",{"path":905,"title":906,"description":907,"category":860,"order":244,"uses":908},"\u002Fexamples\u002Fpublic-cache","Caching public data","Cache what is the same for everyone on a separate public route.",[776,782],{"path":910,"title":911,"description":912,"category":860,"order":291,"uses":913},"\u002Fexamples\u002Fclient-errors","Handling 401, 403 and 503 in the app","Sign out on 401, explain 403, retry on 503.",[914,915],"$fetch.create","onResponseError",{"path":917,"title":918,"description":919,"category":860,"order":315,"uses":920},"\u002Fexamples\u002Ftesting","Testing the protection","An end-to-end test that every protected route refuses anonymous calls.",[921,922],"@nuxt\u002Ftest-utils","vitest",1796451483527,"a99f93bd-e267-45a7-90df-9194cd77468d"]