Skip to content

Fix crash launching the Authress Custom Tab from Application context - #6

Merged
wparad merged 1 commit into
mainfrom
claude/anti-abuse-hash-user-agent-aa8qql
Aug 15, 2026
Merged

Fix crash launching the Authress Custom Tab from Application context#6
wparad merged 1 commit into
mainfrom
claude/anti-abuse-hash-user-agent-aa8qql

Conversation

@wparad

@wparad wparad commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Tapping "Continue" on the login screen crashed with: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag.
  • AuthressLoginClient is built once in AppContainer with the Application context (EmailApp.onCreate()AppContainer(this)), never an Activity. CustomTabsIntent.launchUrl() doesn't add FLAG_ACTIVITY_NEW_TASK itself, so starting the Custom Tab activity from that non-Activity context throws.
  • Extracted both CustomTabsIntent.Builder().build().launchUrl(...) call sites (authenticate() and linkIdentity()) into a shared launchAuthenticationUrl() helper that sets FLAG_ACTIVITY_NEW_TASK on the intent before launching.

Test plan

  • Manual: tap "Continue" on the login screen and confirm the Authress Custom Tab opens instead of crashing
  • Could not run the app in this environment (no Android SDK), so this is reviewed manually — gradle compileDebugKotlin was not re-verified end-to-end here

🤖 Generated with Claude Code

https://claude.ai/code/session_01XRMBgZXVCEVwBuBWapy5J7


Generated by Claude Code

AuthressLoginClient is built once in AppContainer with the Application
context, never an Activity, so CustomTabsIntent.launchUrl needs
FLAG_ACTIVITY_NEW_TASK set explicitly on its intent — without it,
starting the activity throws.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XRMBgZXVCEVwBuBWapy5J7
@wparad
wparad merged commit e621558 into main Aug 15, 2026
2 checks passed
@wparad
wparad deleted the claude/anti-abuse-hash-user-agent-aa8qql branch August 15, 2026 10:54
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