In the client SDKs, what’s the difference between the logOut function and the removeUser functions?
In Swift, those functions are app.currentUser.logOut() and app.currentUser.remove().
According to the doc, the remove function “logs out and destroys the session related to this user”. I’ve been using logOut until now, but I had problems with the session after that (getting invalidSession errors), so I’m guessing I need to use remove instead. But now I’m curious, in what case would you want to use logOut? In which case you don’t want to destroy the session of the logged out user?
logOut() removes the user from the cache - so they will need to logIn again to the server to re-authenticate. remove() removes the user AND removes any data/realms downloaded/opened by the user.