NextJS REST API storing authed User per request

Hello i am looking for a good way to store the current User per request on the backend with NextJS endpoints. I saw in terminals github the usage of node:asyncs_hooks wrapped by an Actor. I like that concept, but i think i dont need to have an AsyncLocalStorage.
Are the best practices to do that? could i just use a Map / an Object instead of the AsyncLocalStorage?
GitHub
terminal/packages/core/src/context.ts at dev · terminaldotshop/term...
Contribute to terminaldotshop/terminal development by creating an account on GitHub.
2 Replies
Neto
Neto3mo ago
LocalAsyncStorage was created for that reason
Balduin
BalduinOP3mo ago
okey, imma read into it
Want results from more Discord servers?
Add your server