Middleware setup + Global Css not getting implemented
Answered
Yacare Caiman posted this in #help-forum
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.
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.
6 Replies
@Yacare Caiman 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.
have you exported matcher from middleware
Answer
IIRC if you haven't it'll run on all paths
even _next
@Anay-208 | Ping in replies have you exported matcher from middleware
Yacare CaimanOP
I have not.
Read the docs. It was right there thank you.
Read the docs. It was right there thank you.
@Anay-208 | Ping in replies Can you mark solution?
Yacare CaimanOP
Yes.