WaspW
Wasp3y ago
David

context.user through middlewareConfigFn

I’ve created an API that uses multer to upload a file via the middlewareConfig, but I’d like to make use of auth to prevent unauthorized access to the route. Context.user returns undefined even when the API is called through the client. Also, even if it were to return an authorization header, how do I prevent the file from uploading before it it reaches the (!contex.user) if statement? I’ve read through the docs, but there is nothing too detailed regarding the use of auth through APIs declared in main.wasp.
Was this page helpful?