How can I pass data from middleware to frontend on solid-start.
I have this middleware to validate a user accesstoken. And the response provides me the name of the user and the validity of the token. While I handle the redirects if valid or not from the middleware. I would like to use the user name in the app layout. How could I pass it down to the client? I can't find a nice solution for it.
The information I'm interested in lives in response.data:
event.locals.user = response.data;
Any help will be appreciated. Thanks!!!2 Replies
You can get the request event with getRequestEvent(); on the client
Let me try that, thanks! 🙂