In passing a JWT to the content api per this browse()
definition, like this:
const fetchtoken = await fetch('/members/api/session')
const memberToken = await fetchtoken.text()
const api = new GhostContentAPI({
url: ***ORIGIN****,
key: '**********KEY***',
version: 'v5.0'
})
const posts = await api.posts.browse({
limit: 'all',
include: 'tags'
}, memberToken)
I see where that JWT is being checked in /services/auth/members, but thus far only get 401 Unauthorized
response.
If I remove the JWT, the request and response goes through without error.
My Questions
-
Am I passing the wrong JWT? As in, is this meant to be a JWT for the logged in Member as I have it, or something else like User?
-
And how does the presence of the JWT affect what is returned by the Content Api (or does it? beyond a can/can’t access?)
Tried to read through the /models/
but wasn’t sure.
Any insight/direction is greatly appreciated, thanks!