Next.js Discord

Discord Forum

Middleware setup + Global Css not getting implemented

Answered
Yacare Caiman posted this in #help-forum
Open in Discord
Yacare CaimanOP
Hi,
I’ve set up middleware so that if a user isn’t logged in, they are redirected to the login page.

The issue is that I have to explicitly include the global CSS file; otherwise, my form (even the one from ShadCN) doesn’t work. Why is that?
Have i setup my app wrong? Im using app router.
Answered by "use php"
have you exported matcher from middleware
View full answer

6 Replies

Answer
IIRC if you haven't it'll run on all paths
even _next
@"use php" have you exported matcher from middleware
Yacare CaimanOP
I have not.
Read the docs. It was right there thank you.
@"use php" Can you mark solution?
Yacare CaimanOP
Yes.