Back

Implement middleware on nextjs

  • 0
  • Web
bluesky
12 Jun, 2023, 03:03

Anyone have use case to implement middleware to protect dashboard & login page?

I try to implement middleware on nextjs with api to check current session, but it's not gonna work.

TL;DR
A user is asking for help with implementing middleware on Next.js. They shared a repo for server side rendering (SSR) and mentioned a potential issue with cookies. Another user suggests sticking with client side code instead of SSR. The first user then asks for examples of implementing middleware to protect dashboard and login pages. They mention trying to implement middleware with an API but it is not working. No solution is provided in the thread.
Drake
12 Jun, 2023, 04:05

Server side rendering is a huge pain. I highly recommend sticking with client side code if possible

Guille
12 Jun, 2023, 13:34

You can check this repo for SSR: https://github.com/Meldiron/appwrite-ssr-next-js

But keep in mind the cookie explanation, as you won't be able to get the appwrite cookie in your middleware if that isn't solved

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