Skip to content
Back

User details in middleware (Next.js)

  • 0
  • Web
  • Cloud
Heeth Jain
1 May, 2024, 04:12

I am following SSR tutorial from Appwrite in Nextjs 14: https://appwrite.io/docs/products/auth/server-side-rendering

How do I get user details in the middleware?

I can get session cookie, but not sure how do I get the user from it?

TypeScript
const session = request.cookies.get(SESSION_COOKIE);

When I try to initialize Client() from node-appwrite, it throws this error:

TypeScript
node:stream
Module build failed: UnhandledSchemeError: Reading from "node:stream" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.
TL;DR
Middleware query on retrieving user details in Next.js using Appwrite tutorial. Developer seeking help on extracting user details from session cookie in middleware. Facing error when initializing `Client()` from `node-appwrite`. Error message: Module build failed due to UnhandledSchemeError.
Heeth Jain
1 May, 2024, 04:21

User details in middleware (Next.js)

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more