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