You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the user performs a configuration change (e.g. rotate the device, change font or display size, change locale, enable / disable dark mode, ...) during the login flow, the Auth0 SDK doesn't deliver the login result correctly to the caller app.
Since the root cause of this issue is the same as #833, and since if you follow the steps below with the demo app on the main branch you get a crash (root cause explained below), you can reproduce this issue by using the demo app from the branch of this PR #832.
Basically, when a configuration change occurs, all the activities in the stack get recreated and the old instances thrown away.
So, the instance that started the login flow with the WebAuthProvider.login is destroyed. When the callback returns it notifies the destroyed activity.
Indeed this also actually leads to a memory leak, since the SDK is referencing a destroyed activity.
This is also the reason why the demo on the main branch is crashing, because the Fragment that was detached from its activity after it was destroyed is receiving the callback and calls the requireContext().
Suggested solution
Also in this case, like #833, the suggested solution is to use the Android's activity result API.
Checklist
Description
If the user performs a configuration change (e.g. rotate the device, change font or display size, change locale, enable / disable dark mode, ...) during the login flow, the Auth0 SDK doesn't deliver the login result correctly to the caller app.
Since the root cause of this issue is the same as #833, and since if you follow the steps below with the demo app on the
mainbranch you get a crash (root cause explained below), you can reproduce this issue by using the demo app from the branch of this PR #832.Basically, when a configuration change occurs, all the activities in the stack get recreated and the old instances thrown away.
So, the instance that started the login flow with the
WebAuthProvider.loginis destroyed. When the callback returns it notifies the destroyed activity.Indeed this also actually leads to a memory leak, since the SDK is referencing a destroyed activity.
This is also the reason why the demo on the
mainbranch is crashing, because theFragmentthat was detached from its activity after it was destroyed is receiving the callback and calls therequireContext().Suggested solution
Also in this case, like #833, the suggested solution is to use the Android's activity result API.
Reproduction
Additional context
No response
Auth0.Android version
3.7.0
Android version(s)
Any