How to access localstorage in middleware.ts file?
Unanswered
Masai Lion posted this in #help-forum
Masai LionOP
I want to protect some routes by checking the localstorage jws token. Is there any way to do that?
2 Replies
Plott Hound
Unfortunately you can't. The local storage is part of the users browser (e.g the client). Middleware runs on the edge, and so does not have access to the users local storage
I'd recommend using sessions instead