Protect all of the app so user HAS to be logged in

What would I need to do I make it so the app is protected and all of the routes (except for the auth stuff) are protected as in user needs to be logged in? also when I tried the middleware.ts file it didn't seem to work
2 Replies
SafeShows
SafeShowsOP2y ago
the middleware ts file
julius
julius2y ago
So the middleware from next-auth only works with JWT, so if you’re on a stock T3-app, you need to enable that first in order for the middleware to work. An alternate approach (there are many) would be to wrap your app in a component that checks the session and displays the signIn page if there isn’t any
Want results from more Discord servers?
Add your server