I have a simple form that captures data from a user. This is just one field and date stamp to track weight on a daily basis.
I use the Meteor authorization package. When a user logs in, I just keep the UserID in the list and then filter the collection for that user ID.
This is normal if I force users to log in before they use the system.
But I would like users to try the system first. That way, they can save 3 or 4 rows of data, and then decide to create an account and save. In the short term, I would just like to save data from this current session (so if they close the browser without saving, their data will be lost). At the second stage, I would like the data to be saved so that if they are not saved, but returned the next day in the same browser, they can still decide to save their data against a permanent account.
I'm currently going to save uuid instead of the standard Meteor.userId for temporary users, and then just replace this value with your new Meteor.UseriD. Long-term storing of a random number as a user ID and storing this data in a permanent client cache, and then overwriting with Meteor.UserID when creating an account.
But I'm a beginner and would like to know if there is a more elegant way to achieve these two goals:
1) Allows the user to record some data that only they can see. Then save this when they want to create an account. 2) Allows the user to record some data that is stored in all sessions. Then save this data when they want to create an account.
James
source share