taczzy
CDCloudflare Developers
•Created by taczzy on 7/12/2024 in #pages-help
Trying to get up an running with the @cloudflare/pages-plugin-stytch
I have the following folder/file structure set up for my CF Page Functions:
Inside of my _middleware.ts file I have the following code:
The documentation on the @Cloudflare/pages-plugin-stytch plugin is pretty light, so I've been reading through the src code for it to better understand it.
My assumption is that when a user goes to my-site.pages.dev, this middleware will run, the @Cloudflare/pages-plugin-stytch will add the validated session response containing user information to subsequent Pages Functions on the
context.data.stytch.session
key. https://github.com/cloudflare/pages-plugins/blob/main/packages/stytch/functions/_middleware.ts#L53-L55
However, when I hit my-site.pages.dev/api/activities in the browser and I check the real-time logs of the context object in that CF Pages Function handler from /api/activities, the data object is empty.
Curious what part of the puzzle I'm missing here. Any help would be much appreciated.1 replies