I’m trying to achieve two related things.
For context, I’m using the cloned example from here in my own app:
- Extending from the above, what’s a good way to authenticate so that only the authorised user can see their own files? It looks like it’s just a url that any client can read, so there’s nothing stopping one from randomly typing filenames in the browser until something hits and they can read another user’s files.
I’ve temporarily worked around this right now by adding a uuid to the file, so that the URL is matched only to the uuid. Not foolproof, but more improbable. Any more secure examples to extend from the above code?
- I want to upload a new file using the FileLoader - and I haven’t commited the changes to the database yet. In this un-uploaded, client-side state, how can I show the preview of the recently-uploaded file? Given the above example, it looks like a URL is needed? Is there a way to do this with unsaved files in the FileLoader? Or perhaps there’s a whole different way to achieve the above without the use of URL’s?
Worked examples in a clone-able workspace are much appreciated, if possible!