Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
6 tasks done
cooperkong opened this issue Mar 14, 2024 · 3 comments
Labels
bug This points to a verified bug in the code

Comments

@cooperkong
Copy link

cooperkong commented Mar 14, 2024

Checklist

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 cooperkong added the bug This points to a verified bug in the code label Mar 14, 2024
@cooperkong
Copy link
Author

cooperkong commented Mar 14, 2024

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

@andreas-umbricht
Copy link

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
Copy link

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.

Screen_recording_20241020_160236.mp4

This is quite an edge-case, so it does not hurt too much, but still a bug that should be addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This points to a verified bug in the code
Projects
None yet
Development

No branches or pull requests

2 participants