Auth0.Android
Auth0.Android copied to clipboard
In AuthenticationActivity intent flag CLEAR_TOP will close previous Activities with Launcher set to `singleTask`
Checklist
- [X] The issue can be reproduced in the Auth0.Android sample app (or N/A).
- [X] I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- [X] I have looked into the API documentation and have not found a suitable solution or answer.
- [X] I have searched the issues and have not found a suitable solution or answer.
- [X] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- [X] I agree to the terms within the Auth0 Code of Conduct.
Description
This issue can be repdocued by thie repo https://github.com/cooperkong/auth0-issue
Reproduction
- launch app
- click on button to launch Auth0 login page
- click Home button to close app
- re-launch again from launcher
- click on button to launch Auth0 login page will cause the app to close
Additional context
Hi Auth- team, I understand there might be a need to CLEAR_TOP when launching AuthenticationActivity but in the example provided, it has unpexpected behaviour.
My suggestion would be
- if it's possible to have an API to specify what intent flag we would pass in to Auth0
- or clean up CustomTabs as soon as the user leaves web auth (background, click on Home, etc..)
essentially what I mean is to move this bit of logic into perhaps
onStop
val resultMissing = authenticationIntent.data == null
if (resultMissing) {
setResult(RESULT_CANCELED)
}
deliverAuthenticationResult(authenticationIntent)
finish()
Auth0.Android version
2.10.2
Android version(s)
12
Here is also a video to reproduce this issue. 3.webm
I ran into the same issue using launchMode="singleInstance". It seems like that in by version 2.11.0 this issue is fixed.
Sadly I found a new, possibly related bug, so I will post it in this thread. After updating to version 2.11.0 using launchMode="singleInstance" usually works fine. But when I move the app into background while CustomTabs is open and then resume the app. The old behavior is still present, where I cannot press the "X" button without closing the entire app.
https://github.com/user-attachments/assets/4e969506-45da-4e10-a7ee-d29a90a317f4
This is quite an edge-case, so it does not hurt too much, but still a bug that should be addressed.
Hi @cooperkong Are you still facing this issue on the latest version of Auth0 android SDK?
Closing this for now. Please feel free to reopen if you are are facing this