syncano-node
syncano-node copied to clipboard
endpoint.get and post don't forward user key
Without manual define x-user-key header, target endpoint don't set user.
const result = await endpoint.get('example/endpoint', {
someData: 'asdf'
}
}, {headers: {'x-user-key': ctx.meta.user.user_key}})
This is not supported in core. We need add some method like in client library e.g. setToken or setUserToken.
@mkucharz Maybe we should always forward user key if it's detected in current request, what do you think?
@Idered No, I think in many cases we don’t want to pass it (especially for private endpoints). It should be more explicit. Maybe some flag?
@mkucharz can you write at least one example? That sub request is still a part of main request which have user data.