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