I’m relatively new to Netlify Identity, so this might be something simple. I’ve read the docs and believe I understand that if I send the access token retrieved by the library in the Authorization header, the claims should be decoded and added as a user object in the context of a function. That does not seem to be happening in my case. I can see the token on the event but nothing in the context. I know I can decode the claims myself, but Im trying to follow the docs. Here is a code sample from my front end:
let id = netlifyIdentity.currentUser()
let token = id.token.access_token
let response = await fetch("/.netlify/functions/addtask", {
method: "post",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${token}`
},
body: JSON.stringify({
name: this.newTaskInput
})
})
Site URL is https://sharp-minsky-8df774.netlify.app
Thanks!