#✅ - When I restart app with an AuthUser, why isnt Auth HubPublisher called?
8 messages · Page 1 of 1 (latest)
Are you expecting a HubPayload.EventName.Auth.signedIn to be sent when the app is reopened?
@austere robin that would be nice. If I make a change, build and load it on my device, my app restarts and depends on the events from amplify auth publisher to know the state of auth.
I dont want to have to manage my own state when it comes to auth
That's totally understandable. The Hub is designed to dispatch events when they happen, e.g. signedIn is dispatched after the user signs in. For your use case, I recommend using fetchAuthSession() to determine if a user is signed in on app launch. For example:
let isSignedIn = try await Amplify.Auth.fetchAuthSession().isSignedIn
cool thanks!
np! I'm resolving this thread now. Please don't hesitate to open a new one or a GitHub issue if you have any other questions.
✅ - When I restart app with an AuthUser, why isnt Auth HubPublisher called?