-
Notifications
You must be signed in to change notification settings - Fork 66
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
Clarification: Do I have to call user.jwt() before every back-end call #75
Comments
In my experience, it will go stale without explicitly calling |
This ⬆️ But the Line 69 in 36dc2a9
However, Netlify functions has an identity context (with an elevated permissions token) set for them so you might not need to send the token at all. See example: |
This is critical information and needs documenting for securing Functions in a production context |
Posting this for others who may come here; this extensive discussion on Netlify Community should answer plenty of questions around using Netlify Identity with Netlify Functions and joining the two |
I am passing the a JWT token to a lamda function on netlify. Currently I am calling
auth.currentUser().jwt()
before eachfetch
to the lamda function endpoint. Is it possible to call.jwt()
once after a user logs in and cache it somewhere in my react app? Or is it needed to do this just-in-time of when I am going to use it.Will the token expire or go stale? If so when?
The text was updated successfully, but these errors were encountered: