`isAuthenticated()` state in android sdk did not reactive for top-activity
i have 2 activity, first one initialize the sdk and the state is unauthenticated, then click a button to go into second activity which display user information and will do authentication there.
then if i login in second activity, when i get back to first activity,
isAuthenticated() still false because the sdk is not reactive for the whole apk.4 Replies
the sdk need to provide a viewmodel i guess
or atleast provide a way to validate the token and manually assign the store
Hey @BanDroid,
Thanks for the detailed explanation, that makes sense. I’ll check in with one of our SDK experts about this behavior and get back to you as soon as I have more details.
this PR gives solution to this issue
https://github.com/kinde-oss/kinde-sdk-android/pull/28
so basically the
auth_state is exist when onNewToken and removed onLogout, so rather than making a prop to store a isAuthorized value, just take the isAuthenticated using the auth_state prefsGitHub
isAuthenticated() now rely on shared prefs by BanDroid · Pull Requ...
this needed in case other initialization from different activities could share the same value rather than relying on in-memory object, this is atleast a solution for issue #27 so the sdk could chec...
Hey @BanDroid,
Thanks for sharing the PR and the explanation. This is really helpful. I’ve passed it along to our team so they can review the approach and see how we can incorporate it into the SDK.
I’ll keep you updated once I hear back from them.