I tried to follow the iOS guide to link an anonymous user to the newly created with email and password https://docs.mongodb.com/realm/sdk/ios/advanced-guides/link-user-identities/
The first time it failed with an error
AuthError Error - confirmation required. It was descriptive enough so I just go through the confirmation flow first.
The second time it failed with an error
InvalidSession Error - invalid session. I thought it might be because the user is in the
Pending User Login state so I decided to proceed with login.
The third time it failed with the same error
InvalidSession Error - invalid session when I tried to log in as anon, then login as email/password and link after that.