formio / cli

The Form.io command line interface.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Separate credentials for destination are not used if source and destination are on same host

HajoAhoMantila opened this issue · comments

I want to copy data between forms on two different projects hosted on form.io. When running

formio migrate https://myprojecta.form.io/someform form https://myprojectb.form.io/someform --src-key abc1234 --dst-key cde2468

the CLI will use the src-key for both source and destination. The result is that reading the data from the source succeeds, but writing it to the destination results in "Unauthorized" errors.

The issue here is that the CLI currently assumes that all endpoints on the same hostname (in this case "form.io") use the same authentication (in src/authenticate.js line 200, the subdomain is not taken into account for the comparison).

I suggest that the whole URL is used in the comparison. If source and destination share the same credentials, the user can supply them twice as parameters.

Hello Hajo,

This is William with the Form.io support team. Great to hear from you!

We have created a ticket and have tagged you in it. For reference, the ticket number is FOR-1557.

We will let you know if this issue is resolved. In the meantime, you can either write your own script to copy forms or put in a pull request to fix the issue in formio-cli

Thanks,
William Gay

We're currently addressing a backlog of GitHub issues. Closing this thread as it is outdated. Please re-open if it is still relevant. Thank you for your contribution!