-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessing clientContext in a Function locally #1
Comments
I'm having the same issue @oliverjam @biilmann, also it's hard to test things in production bc we don't have access (afaik) to the lambda function logs, so running things locally would be awesome. |
FYI It looks like local lambdas don't support Identity for now: see this issue @renschler you can access production lambda logs from your Netlify dashboard. Open up a site, go to the Functions page and then click a function to see the logs |
Awesome thanks @oliverjam |
we support it now! netlify/netlify-lambda#57 |
@sw-yx Yesss thank you! 🙏 |
Hey Matt, thanks for the useful example. I was using your blog post to get started with authenticated Functions on Netlify, but I'm struggling to get it to work locally.
I'm sending the user jwt as a a bearer token in the authorization header and then accessing
context.clientContext
in the lamda. This works perfectly on my deployed site, butclientContext
is always undefined locally even when I'm logged in.Is this a limitation of the Identity and Functions integration or is there some configuration I need to do?
Edit: I've reproduced it at this URL https://friendly-jackson-0a3bb9.netlify.com. If you log in there and send a message you should see the response in dev tools come back with the claims in the body.
If you clone the repo and run locally and do the same thing you get an empty object back.
The text was updated successfully, but these errors were encountered: