RawCMS icon indicating copy to clipboard operation
RawCMS copied to clipboard

Passing token into javascript context

Open zeppaman opened this issue 4 years ago • 0 comments

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

zeppaman avatar Mar 13 '20 18:03 zeppaman