Merge pull request #1365 from hefler/doc-1364-next.js-ssr-auth-demo-add-await-to-code

doc: Added `await` to cookies().get() promise
This commit is contained in:
Luke B. Silver
2024-12-03 15:46:14 +00:00
committed by GitHub

View File

@@ -20,7 +20,7 @@ export async function createSessionClient() {
.setEndpoint(process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT)
.setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT);
const session = cookies().get("my-custom-session");
const session = await cookies().get("my-custom-session");
if (!session || !session.value) {
throw new Error("No session");
}