budibase icon indicating copy to clipboard operation
budibase copied to clipboard

Public form show "Session not authenticated" when user try to upload an attachment

Open HMXHIU opened this issue 2 years ago • 5 comments

Hosting

  • Self
    • Method: docker compose
    • Budibase Version: 1.0.158

Describe the bug Public form show "Session not authenticated" when user try to upload an attachment.

To Reproduce Steps to reproduce the behavior:

  1. Create new app
  2. Add a form and attachment component
  3. Set both the read and write table permission to public
  4. Publish app
  5. Open app in incognito and try to upload any file.

Expected behavior User are able to upload attachment in public form without sign-in

Screenshots Screenshot 2022-05-18 at 11 01 35

Additional context The id in upload URL was undefined

HMXHIU avatar May 18 '22 03:05 HMXHIU

Additional context:

  • reproduced on Safari for IOS, Safari for macOS, Chrome for IOS, Chrome for macOS.
  • works with Edge for macOS

raziele avatar May 21 '22 20:05 raziele

Updates:

Turns out it was due to the setting of schema in form component. It will work if I set the form schema to follow a public table schema but does not work for all other options. Maybe there is something wrong with the authentication check for schema when user are not signed in.

Screenshot 2022-05-26 at 11 46 48

HMXHIU avatar May 26 '22 03:05 HMXHIU

Hi Guys,

Facing the same issue, in my case schema is custom, as the form fields i am storing in different table and attachment in budibase db table. So the form schema is custom and I am using 2 steps to save form:

  1. fields in mysql db
  2. attachment in budibase db.

Is there any immediate fix or workaround for this ?

mayanktiwaridotcom avatar Jun 09 '22 08:06 mayanktiwaridotcom

This issue has been automatically marked as stale because it has not had recent activity.

stale[bot] avatar Aug 10 '22 04:08 stale[bot]

Updates:

Turns out it was due to the setting of schema in form component. It will work if I set the form schema to follow a public table schema but does not work for all other options. Maybe there is something wrong with the authentication check for schema when user are not signed in.

Screenshot 2022-05-26 at 11 46 48

@HMXHIU This resolved the problem than you so much!

I would recommend @mayanktiwaridotcom to make all the tables public like this case https://github.com/Budibase/budibase/issues/4582#issuecomment-1054444261 including the tables on the MySQL database.

charlfields avatar Sep 21 '22 12:09 charlfields

Thanks for the extra info guys!

I've added a section to the docs to explain this: https://docs.budibase.com/docs/attachments#manage-access

melohagan avatar Sep 23 '22 10:09 melohagan