Skip to content

Commit

Permalink
docs(edge-api-routes): fixes example (#42903)
Browse files Browse the repository at this point in the history
## πŸ“– What's in there?

The last example on the documentation page for [Edge Api routes](https://nextjs.org/docs/api-routes/edge-api-routes) is wrong since next@13 breaking change on cookie handling.
While [middleware page](https://nextjs.org/docs/advanced-features/middleware#using-cookies) is updated, this one was left off.
  • Loading branch information
feugy committed Nov 14, 2022
1 parent 230571c commit 9faba36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/api-routes/edge-api-routes.md
Expand Up @@ -95,7 +95,7 @@ export const config = {
}

export default async function handler(req: NextRequest) {
const authorization = req.cookies.get('authorization')
const authorization = req.cookies.get('authorization')?.value
return fetch('https://backend-api.com/api/protected', {
method: req.method,
headers: {
Expand Down

0 comments on commit 9faba36

Please sign in to comment.