-
I want users to be able to do things on my app (like add items to a cart) anonymously. Then, when they sign in or register, I want to transfer that cart over to their account.
Is that possible with FusionAuth?
-
Yes, you can do this.
There are a couple of different approaches, they both require a bit of glue code.
You could create a user in FusionAuth with a name like anon-<uuid>@example.com and a known random password. Then create a JWT for that account using the login API. Add info to that account, then if/when the user registers, transfer that account info to the new user. You could even update the email address of the anon-<uuid>@example.com account and reset their password. This would be accomplished via the user API.
An alternative approach is to use the Vend JWT API to create a JWT for your anonymous user. This can look like anything, it's entirely freeform. When the user registers, you can take the info referenced by that JWT and transfer it to the new user.
If these don't meet your needs, feel free to open a GitHub issue with a specific use case.
-
D dan has marked this topic as solved on
-
D dan moved this topic from Q&A on
-
D dan moved this topic from Frequently Asked Questions (FAQ) on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login