Hey peeps I'm encountering some
Hey peeps I'm encountering some mysterious behaviour. My Pages Function is throwing intermittent 401 errors. I traced the code back to some packages I'm using:
@propelauth/cloudflare-worker
which calls jose
.
Debugging that shouldn't be a problem. The issue is that the 401 request that I receive in my browser is not reflected in the Real Time Logs stream.
It's mysterious because it's only ever this intermittent error that does not show up. Every other request I make I can see in the logs stream. I even deployed changes with dummy errors and they show up as expected.
It's also odd that a global try catch does not work around the auth code. There shouldn't be a code path for a 401 if I wrap my auth logic in a try/catch and throw a 418 for example.
App is a Nuxt 3.15.4 app on Cloudflare Pages. Appreciate any help.1 Reply
Here is my Nitro middleware that handles auth: