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

[Android] Keep authentication on the same activity stack #156

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

Mino5531
Copy link

This PR changes the authentication process on Android, so that the chrome custom tab window opens on the same activity stack as the flutter application and no longer opens a new activity stack or window. This should improve end user experience as it is no longer possible for users that leave the application, to copy a 2FA code for example, to return to the wrong "window"

This all is achieved by starting a new activity (in this case AuthenticationManagementActivity) before starting the chrome custom tab. The CallbackActivity will then start the AuthenticationManagementActivity which will then finish and return to the original flutter activity.

Breaking changes
Applications must register a new activity:

<activity android:name="com.linusu.flutter_web_auth_2.AuthenticationManagementActivity">
</activity>

@ThexXTURBOXx ThexXTURBOXx merged commit af583aa into ThexXTURBOXx:master Mar 5, 2025
2 checks passed
@ThexXTURBOXx
Copy link
Owner

Thank you very much for your contribution! I have looked through it and it works wonders! :)
Will publish this today as part of a 5.x alpha

@Mino5531 Mino5531 deleted the android-auth-same-stack branch March 5, 2025 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants