After today’s meet-up about Cosync JWT, I modified some of my code to use the Custom JWT that they provide and am now saving the JWT token in the keychain during login and using that to reauthenticate when a user returns to the app.
The issue I’m having is that if the user really wants to be able to do offline first, the realm needs to be able to open without signal. If the app is open and the user is logged in and then loses signal, the app continues to work.
But if there is no signal when the app is opened, I check for a stored token and then attempt to log in. Obviously, that fails.
Is there a way to open the realm locally with a stored token without reconnecting to the server to truly do offline first?
If you do not call logOut() then the user is cached and the app can open the realm by passing in the cached user reference to the realm without signal. If you want to use the app offline I’d recommend not calling logOut()