Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Added await to cookies().get() promise #1365

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

hefler
Copy link

@hefler hefler commented Sep 19, 2024

What does this PR do?

cookies().get() is an asynchronous function. Adding await to the sample code ensures that the cookie is read prior to moving to the next instructions. Not handling this as a promise makes it prone for the code to not run as intended and hard to debug.

Test Plan

Not needed, sample code just follows the standards https://wicg.github.io/cookie-store/#CookieStore-get

Related PRs and Issues

Fixes #1364

Have you read the Contributing Guidelines on issues?

Yes

@coolify-appwrite-org
Copy link

coolify-appwrite-org bot commented Sep 19, 2024

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2024-11-13 10:32:29 CET

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📚 Documentation: add await to cookies().get() as it returns a promise next.js-ssr-auth demo
2 participants