Skip to content

Commit

Permalink
Don't fail auth flow in case of non-MainFrame error
Browse files Browse the repository at this point in the history
  • Loading branch information
XanderZhu committed Jul 25, 2023
1 parent 52dfa3c commit ee784d2
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@ class AuthSocialWebViewClient(
request: WebResourceRequest?,
error: WebResourceError?
) {
onNewMessage(
AuthSocialWebViewFeature.Message.AuthCodeFailure(
socialError = AuthSocialError.CONNECTION_PROBLEM,
originalError = if (error != null) Exception(error.description.toString()) else null
if (request?.isForMainFrame == true) {
onNewMessage(
AuthSocialWebViewFeature.Message.AuthCodeFailure(
socialError = AuthSocialError.CONNECTION_PROBLEM,
originalError = if (error != null) Exception(error.description.toString()) else null
)
)
)
}
}

override fun onPageFinished(view: WebView?, url: String?) {
Expand Down

0 comments on commit ee784d2

Please sign in to comment.