filestack / filestack-rails

Official Ruby on Rails plugin for Filestack File Picker that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
https://www.filestack.com
Apache License 2.0
223 stars 102 forks source link

`filestack_js_init_tag` creates incorrect JS code when including security policy #205

Closed diegous closed 5 years ago

diegous commented 5 years ago

filestack_js_init_tag generates JS code like this one

var filestack_client = filestack.init('someApiKey', {'signature': 'xxx', 'policy': 'yyy'}, '');

but that is not the format that the js client accepts, the signature and policy object should be inside another object referenced bye the security key, like this

var filestack_client = filestack.init('someApiKey', { 'security': {'signature': 'xxx', 'policy': 'yyy'}}, '');

as shown in this doc page

gabifija commented 5 years ago

@diegous - it is already fixed in version 4.0.4. Thank you for your PR!