formtools / core

The Form Tools Core.
https://formtools.org
207 stars 78 forks source link

Making Views accessible to non-loggedin/guest users #786

Open aditya-v2 opened 3 years ago

aditya-v2 commented 3 years ago

I just downloaded formtools, created couple of forms and views to display the form submissions. All this works great from Admin account or a Client account.

Now I want to make the Views available to non-loggedin / guest users as well so that they can see the data that has been created on the site. But I am not seeing any option to make these views accessible to everyone. Even after setting it as "Public", I must login as a Client in order to see these views.

Any help would be really appreciated.

ghost commented 3 years ago

Hey There!

There is a few ways you can do what you're looking for off the top of my tounge.

  1. You could use the v2 API to expose the data via a custom PHP script. https://docs.formtools.org/api/v2/show_submissions/ This would provide you the most customization of the content since you can manage what is shown to the end user on a special page outside of your Form Tools instance.
  2. Depending on how secure the data in your Form Tools instance is, a pattern you could use (and has it's own risks - so I caution this a bit more) is you could create an account that has View only access to the form, and then use a middle man page on your server where is a user lands on it, they are automatically logged into Form Tools. You would then redirect them to Form Tools client home page after you log them in via the API. https://docs.formtools.org/api/v2/login/ The risk with this method however is again, users you don't know are logged into your instance which poses it's own risks and you should take care to make sure they can't edit anything, access any data you don't expect, or mess with that protected account.

Hope this helps!