Is it ok to check
Amplify.Auth.getCurrentUser() != nil
or should the app maintain a state variable and set that from this listener?
_ = Amplify.Hub.listen(to: .auth) { payload in
switch payload.eventName {
case HubPayload.EventName.Auth.signedIn:
// Update UI
....
If it's the latter, is that suppose to work even if the user logged in during one of the previous sessions?
After further research and from Discord discussions looks like this is the best approach: