Skip to main content
Answer

Is it safe to call login() with a different id?

  • December 10, 2024
  • 1 reply
  • 41 views

mariusbolik
Forum|alt.badge.img+5

We recently changed our auth provider and our users now have different IDs. Is it okay to call `login()` again with another user id and call `syncPurchases()` afterwards, grant the user acces to his purchses again? Or should I set an alias?

 

Kind regards,
Marius

Best answer by joan-cardona

Hi ​@mariusbolik,

Be aware of the different ways to transfer purchases between users, it’s worth reading this guide.

If you call logIn() it will create a new user rather than creating an alias (check here for all the different options). Depending on what transfer behavior you have it’ll work one way or another. The default behavior should be enough to have everything working but I’d check first in sandbox that everything works as you expect!

Best,

This post has been closed for comments

1 reply

joan-cardona
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • Answer
  • December 12, 2024

Hi ​@mariusbolik,

Be aware of the different ways to transfer purchases between users, it’s worth reading this guide.

If you call logIn() it will create a new user rather than creating an alias (check here for all the different options). Depending on what transfer behavior you have it’ll work one way or another. The default behavior should be enough to have everything working but I’d check first in sandbox that everything works as you expect!

Best,