Merging temporary user data on returning user login

How do you handle merging temporary data with a returning user when they login?

In my Bubble app, users can create data before logging in—this happens across several pages and includes data created from both front-end workflows and backend API workflows. When a returning user logs back in , I need to associate that previously created temporary data (stored in the database without a user attached) with their user account.

Has anyone managed a similar workflow for handling returning users? Specifically:

  • How do you persist and track the data before login?
  • How do you merge or reassign that data to the logged-in user?
  • Any best practices for linking data created anonymously (or by a temporary ID) to a user after authentication?

As a bonus issue I’m facing, I’m using page parameter keys to pass data in the url from one page to the next. This is causing the facebook sso to return an error of “this url is not whitelisted”

Thank you for your help!

Bubble stores anything saved by a logged-out user for 72h, making use of a built-in cookie-based feature. So, if the user logs in during that time, all data stored previously would be accesible.