diff options
author | 2023-10-03 23:11:52 +0700 | |
---|---|---|
committer | 2023-10-03 09:11:52 -0700 | |
commit | 1acc8191f58c69333e941e28e7804fbc3da2595e (patch) | |
tree | b0c159b56e9f41233a046cd29ebc7eae01f12858 | |
parent | 0ee04261b92a5c366f5fb80cbdac3382d14db944 (diff) | |
download | bun-1acc8191f58c69333e941e28e7804fbc3da2595e.tar.gz bun-1acc8191f58c69333e941e28e7804fbc3da2595e.tar.zst bun-1acc8191f58c69333e941e28e7804fbc3da2595e.zip |
Docs: Update context.md (#6256)
Use token from cookies, not from ws.data
-rw-r--r-- | docs/guides/websocket/context.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/guides/websocket/context.md b/docs/guides/websocket/context.md index 9e387d685..8658c5d4b 100644 --- a/docs/guides/websocket/context.md +++ b/docs/guides/websocket/context.md @@ -47,7 +47,7 @@ Bun.serve<WebSocketData>({ // use a library to parse cookies const cookies = parseCookies(req.headers.get("Cookie")); const token = cookies["X-Token"]; - const user = await getUserFromToken(ws.data.authToken); + const user = await getUserFromToken(token); const upgraded = server.upgrade(req, { data: { |