SolidJSS
SolidJSโ€ข16mo agoโ€ข
7 replies
dohn

What's the correct way to wrap server functions?

I have a bunch of duplicate authentication and validation logic in my server functions that I'd like to extract to a utility like createAuthenticatedAction that authenticates the user before running the server callback passed to it, but every time I create any wrapper around "use server" the compiler stats complaining. Where should I put a "use server" directive if I only want this helper to run on the server?
Was this page helpful?