How to access the full custom session in a middleware?
Hi! I’m trying to access my full custom session inside a middleware, but it seems like getCookieCache() doesn’t return my custom session data.
Currently, I’m calling betterFetch('/api/auth/get-session') from the middleware as a workaround, but I’m wondering if there’s a better or more efficient way to directly access the complete session (including custom fields) within middleware?
Any tips or best practices would be greatly appreciated. Thanks in advance!
Currently, I’m calling betterFetch('/api/auth/get-session') from the middleware as a workaround, but I’m wondering if there’s a better or more efficient way to directly access the complete session (including custom fields) within middleware?
Any tips or best practices would be greatly appreciated. Thanks in advance!