diff --git a/docs/content/docs/integrations/waku.mdx b/docs/content/docs/integrations/waku.mdx index b09a36c793..e20898e578 100644 --- a/docs/content/docs/integrations/waku.mdx +++ b/docs/content/docs/integrations/waku.mdx @@ -73,12 +73,13 @@ The `api` object exported from the auth instance contains all the actions that y "use server" // Waku currently only supports file-level "use server" import { auth } from "./auth" -import { unstable_getContext as getContext } from "waku/server" +import { unstable_getHeaders as getHeaders } from "waku/server" export const someAuthenticatedAction = async () => { "use server" + const headers = getHeaders() const session = await auth.api.getSession({ - headers: new Headers(getContext().req.headers), + headers, }) }; ``` @@ -88,20 +89,21 @@ export const someAuthenticatedAction = async () => { ```tsx import { auth } from "../auth" -import { unstable_getContext as getContext } from "waku/server" +import { unstable_getHeaders as getHeaders } from "waku/server" export async function ServerComponent() { - const session = await auth.api.getSession({ - headers: new Headers(getContext().req.headers), - }) - if(!session) { - return
Not authenticated
- } - return ( -
-

Welcome {session.user.name}

-
- ) + const headers = getHeaders() + const session = await auth.api.getSession({ + headers, + }) + if(!session) { + return
Not authenticated
+ } + return ( +
+

Welcome {session.user.name}

+
+ ) } ```