nextauthjs / nextauthjs/next-auth

bug: lost asyncLocalStorage in server actions

Open
#7,633 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triage
Dominant language
TypeScript
Stars
28.4k
Forks
4k
PR merge metrics
No merged PRs in 30d

Description

Environment

System:
OS: macOS 13.3.1
CPU: (8) arm64 Apple M1 Pro
Memory: 926.67 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.16.0 - ~/Library/Caches/fnm_multishells/3962_1684784742591/bin/node
Yarn: 1.22.19 - ~/Library/Caches/fnm_multishells/3962_1684784742591/bin/yarn
npm: 9.5.1 - ~/Library/Caches/fnm_multishells/3962_1684784742591/bin/npm
Browsers:
Safari: 16.4

Reproduction URL

coming soon

Describe the issue
CleanShot 2023-05-23 at 13 41 32@2x
How to reproduce

Call getServerSession inside a server action

Expected behavior

session retrieval to be successful

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue at the getServerSession entry point inside a Next.js server action, using the reported Node 18.16.0 environment and the provided screenshot as context. Done means session retrieval succeeds without losing asyncLocalStorage.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, node.js, typescript
Domain
authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.