Hello,
I would like to implement a short session expiration (lets say one month) for following case:
- User log in on his second device (username+password or apple)
-
afterLogin
trigger checks number of sessions and if > 1 anmultiDevice = true
is set inUser
- if
multiDevice = true
then the client will open liveQuery also on user’sUser
andProfile
documents → to sync the changes done on second device to first - on
afterLogout
would againmultiDevice = true
checked
If the user would lost or stopped using his device the session would get expired and there would be no sync need.
But how can I renew sessionToken without going through the onboarding and login screen again? Do I understand it right that I have to save username+password to keychain and login again in background? For appleID this can’t even be done in background as a need UI view pops up for confirmation.
I see there was some work done on OAuth, but unfortunately got quiet here. Would that help to cover this problematic (both appleID and username+password)?