Repository navigation
Sign-in: show the real error, handle the redirect on cold start - #35
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The tab closes, but the only feedback was "Could not sign in to Bansify" — which hides the cause.
Two changes
completeSignInalready throws with the server'serror/error_description, but the ViewModel replaced it with a generic string. It now shows the message (140 chars), soinvalid_grant,redirect_uri or client mismatch,PKCE verification failedandNo sign-in was in progressare finally distinguishable.onNewIntent. If Android killed the process while the consent page was open, the callback arrived inonCreate, 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 fromhandleIncomingIntent, 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.