Project on Yii2 . I connect Backbone.js scripts to a specific view. It turns out that the user is authorized through yii2, but the backbone does not know anything about the user. There is a separate API for this server.
So the question is : how on the side of Backbone understand which user is authorized on the site? I connect the backbone in the index [view] page and access the server API to get the data, but in fact I must pass in the request header the user ID
access_token
. How to be? How to get it without passing authorization through the backbone, and transfer it directly from the yii application?