Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collections should be tracked in the db regardless of authentication status #299

Open
jps327 opened this issue Jul 20, 2022 · 0 comments
Open
Labels
backend Mostly backend work frontend Mostly frontend work

Comments

@jps327
Copy link
Contributor

jps327 commented Jul 20, 2022

From a discussion in #297

yes, we definitely do need to rethink how sharing URLs work. The way it works right now is just not good. That is definitely outside the scope of this PR though. But in short, my opinion is that every collection should be stored in the DB. It doesn't matter if the user is authenticated or not.

If the user is authenticated, this is easier. The collection can just be linked to that user.
If the user is not authenticated, instead each unauthenticated should be given a session ID that is generated by the browser. A collection will be linked to the session ID instead. This means that we will need a new column in the collections to hold a session ID, and it should only be filled when this is an unauthenticated collection.

Now that each collection has a UUID that can be looked up in the db (regardless of whether they are authenticated or not), then we can created shareable URLs using the UUID instead of storing all the collection metadata in the URL (which as you pointed out is editable and not a useful way of persisting data).

TLDR: all collections should be tracked in the db. Collections by unauthenticated users should be linked to their session ID (generated by the browser)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Mostly backend work frontend Mostly frontend work
Projects
None yet
Development

No branches or pull requests

1 participant