Auth0.Android icon indicating copy to clipboard operation
Auth0.Android copied to clipboard

In AuthenticationActivity intent flag CLEAR_TOP will close previous Activities with Launcher set to `singleTask`

Open cooperkong opened this issue 1 year ago • 3 comments
trafficstars

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

  1. launch app
  2. click on button to launch Auth0 login page
  3. click Home button to close app
  4. re-launch again from launcher
  5. 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

cooperkong avatar Mar 14 '24 02:03 cooperkong

Here is also a video to reproduce this issue. 3.webm

cooperkong avatar Mar 14 '24 02:03 cooperkong

I ran into the same issue using launchMode="singleInstance". It seems like that in by version 2.11.0 this issue is fixed.

andreas-umbricht avatar Oct 20 '24 13:10 andreas-umbricht

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.

andreas-umbricht avatar Oct 20 '24 14:10 andreas-umbricht

Hi @cooperkong Are you still facing this issue on the latest version of Auth0 android SDK?

pmathew92 avatar Dec 13 '24 07:12 pmathew92

Closing this for now. Please feel free to reopen if you are are facing this

pmathew92 avatar Mar 10 '25 05:03 pmathew92