Hi! I'm trying to convert anonymous accounts to a normal account using a magic url instead of creating an account. Is there a way to do this?
For each visitor I automatically create an anonymous session (together with a document to store data). If the visitor wants to sign up, I want to convert the anonymous account to a normal account. I know I can do this by updating the email and password or create an OAuth2 session. However I want the visitor to sign in using a magic link.
So far, I tried to programmatically create an account using the email and a generated password. Next, I create a magic link session. This works, but only the first time. As soon as the account/email exists and the user wants to login in a different browser, it does no longer work. In this case I can bypass the account creation and only send the magic link. This also works, however I end up having unused anonymous accounts. Is there a proper way to do resolve this using the Web SDK? Or do I need to create a function to do the cleanup?
Appreciate your help.