arduosoft / RawCMS

RawCMS is the headless CMS written in asp.net core build for developers that embraces API first technology. Please give us a feedback!
https://forms.gle/wvu1HF9P52ZdXujv6
GNU General Public License v3.0
173 stars 72 forks source link

Passing token into javascript context #233

Open zeppaman opened 4 years ago

zeppaman commented 4 years ago

expected

The javascript lambdas allow us to add custom code at runtime, like the example on demo where we can compute latitude. inside this context, we could make a request to the public Rawcms but we miss an authentication token. we would have a "token" variable to be used on making HTTP call with the same user of the original caller.

todo

inside the javascript engine, the authentication header must be added as variable to the javascript context. The place where do the change is https://github.com/arduosoft/RawCMS/blob/develop/RawCMS.Library/Lambdas/JsDispatcher.cs and https://github.com/arduosoft/RawCMS/blob/develop/Plugins/RawCMS.Plugins.Core/Controllers/JsLambdaController.cs

acceptance criteria

we have a lambda that use the token parameter to call another api passing the header