realm-dotnet icon indicating copy to clipboard operation
realm-dotnet copied to clipboard

Add LogOutAsync method without user deletion

Open papafe opened this issue 1 year ago • 2 comments

Currently, the user.LogOutAsync method also removes the user data. We should modify the method to have an optional boolean LogOutAsync(bool deleteUser = true) so that developers can decide what they want to do exactly, with a default value of true to keep the same behaviour we have now

papafe avatar Feb 08 '24 09:02 papafe

It is not possible to SignIn with sync again after LogOut in same app session. Always got exeption: Realms.Exceptions.RealmMismatchedConfigException: Realm at path '<path to realm db>' already opened with different sync user.

aliegeni avatar Mar 22 '24 22:03 aliegeni

Sounds like something is keeping the Realm file open with the logged out user. While we should probably look into automatically closing all files owned by the user upon logout, you could also work this around in your app by making sure to dispose of all Realm instances currently opened by the user you want to log out.

nirinchev avatar Mar 22 '24 23:03 nirinchev