No, no, no authentication in layout while using sveltekit ... It becomes stale upon navigation. Use individual page load functions to check authentication. The Problem with Using Layouts for Auth ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-UbhhJWV3bmI.html Protect SvelteKit Routes with Hooks ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-K1Tya6ovVOI.html
You can actually write middleware outside of the middleware.ts file in Next.js. It’s not as pretty as connect-style middleware, but it is possible. In app router, you simple create a higher-order function that either returns a response or calls the route handler, which is passed in as a parameter.
@@WesBos Nothing in particular, just the way you explained the concept and dropped some examples of implementation was quite intriguing, so a topic related to backend would be more than welcome also subscribed you.