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