Skip to content

Commit 192a8fe

Browse files
authored
[docs] update handle hooks docs (sveltejs#3433)
1 parent 9efebb1 commit 192a8fe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

documentation/docs/04-hooks.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ export interface Handle<Locals = Record<string, any>> {
4141
}
4242
```
4343

44-
To add custom data to the request, which is passed to endpoints, populate the `request.locals` object, as shown below.
44+
To add custom data to the request, which is passed to endpoints, populate the `event.locals` object, as shown below.
4545

4646
```js
4747
/** @type {import('@sveltejs/kit').Handle} */
48-
export async function handle({ request, resolve }) {
49-
request.locals.user = await getUserInformation(request.headers.cookie);
48+
export async function handle({ event, resolve }) {
49+
event.locals.user = await getUserInformation(event.request.headers.get('cookie'));
5050

51-
const response = await resolve(request);
51+
const response = await resolve(event);
5252
response.headers.set('x-custom-header', 'potato');
5353

5454
return response;

0 commit comments

Comments
 (0)