Skip to content

Sign-in: show the real error, handle the redirect on cold start - #35

Merged
GothwadTech merged 1 commit into
mainfrom
fix/oauth-show-error
Dec 4, 2026
Merged

GothwadTech merged 1 commit into
mainfrom
fix/oauth-show-error

Conversation

@GothwadTech

Copy link
Copy Markdown
Collaborator

The tab closes, but the only feedback was "Could not sign in to Bansify" — which hides the cause.

Two changes

  1. The snackbar shows the actual failure. completeSignIn already throws with the server's error / error_description, but the ViewModel replaced it with a generic string. It now shows the message (140 chars), so invalid_grant, redirect_uri or client mismatch, PKCE verification failed and No sign-in was in progress are finally distinguishable.
  2. Cold-start redirect. The OAuth check lived only in onNewIntent. If Android killed the process while the consent page was open, the callback arrived in onCreate, where it was treated as a URL and opened as a tab — the code was dropped and sign-in silently did nothing. It is now routed from handleIncomingIntent, which both paths call.

Next

Install the build, try sign-in once. If it still fails, the snackbar will now name the reason — that string is what closes this out.

…d start

The tab closes now, but the user only ever saw "Could not sign in to Bansify", which hides
the one thing that matters: why.

- The failure snackbar now shows the exception message (trimmed to 140 chars), so
  invalid_grant, a redirect mismatch, a PKCE failure and a missing verifier stop looking
  identical.
- MainActivity routes the OAuth redirect from handleIncomingIntent, so a callback that
  arrives on a cold start (process killed while the consent page was open) is exchanged
  instead of being opened as a web page.
@GothwadTech
GothwadTech merged commit 5387362 into main Dec 4, 2026
4 checks passed
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.

1 participant