simplestake
simplestake
WWasp-lang
Created by simplestake on 8/21/2023 in #🙋questions
rawBody through apiNamespace
@shayne
10 replies
WWasp-lang
Created by simplestake on 8/21/2023 in #🙋questions
rawBody through apiNamespace
@miho is there any way to remove the strings that sometimes appear when a page loads? Such as “Loading …” or “Completing log in process…”?
10 replies
WWasp-lang
Created by simplestake on 8/21/2023 in #🙋questions
rawBody through apiNamespace
Awesome, thanks that worked! @miho
10 replies
WWasp-lang
Created by simplestake on 6/24/2023 in #🙋questions
context.user through middlewareConfigFn
I didn’t find user in the request, so the next best thing was parsing the header myself. I don’t think user is included in the middleware req.
11 replies
WWasp-lang
Created by simplestake on 6/24/2023 in #🙋questions
context.user through middlewareConfigFn
Yes, the authorization header is parsed and verified using jwt.verify (the secret key is "DEVJWTSECRET" for the dev env). As you suggested, the apiNamespace feature was used to correct the cors issues I was having. In the middleware, cors is configured first, then the authorization, and the file is then uploaded via multer. If you have any questions let me know. I'd be happy to share more details. Thanks again.
11 replies
WWasp-lang
Created by simplestake on 6/24/2023 in #🙋questions
context.user through middlewareConfigFn
Good luck on your trip! I got it to work using the apiNamespace feature and the Authorization header. Thanks again for your help!
11 replies
WWasp-lang
Created by simplestake on 6/24/2023 in #🙋questions
context.user through middlewareConfigFn
Also, if I use api.post in the client, I’m having issues with cors preventing me from uploading the file. However, if i change it to fetch I can upload the file, but context.user is undefined.
11 replies
WWasp-lang
Created by simplestake on 6/24/2023 in #🙋questions
context.user through middlewareConfigFn
Thank you for your help. My code looks something like: export const uploadVideoMiddlewareFn: MiddlewareConfigFn = (middlewareConfig) => { middlewareConfig.set(“context”, authMiddleware); middlewareConfig.set(“multer”, upload.single(“file”) } However, authMiddleware only receives req res and next as arguments. If I use context.user in the actual api function, the file would have already be uploaded since it has passed through the middleware.
11 replies