Skip to content

Instantly share code, notes, and snippets.

@ademar111190
Created March 16, 2023 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ademar111190/e0ed3c45350bd9a4a23589522dcb83c6 to your computer and use it in GitHub Desktop.
Save ademar111190/e0ed3c45350bd9a4a23589522dcb83c6 to your computer and use it in GitHub Desktop.
Auth error diff
diff --git a/android/app/src/main/java/com/breez/client/plugins/breez/breezlib/GoogleAuthenticator.java b/android/app/src/main/java/com/breez/client/plugins/breez/breezlib/GoogleAuthenticator.java
index 52319507..0b05f5b8 100644
--- a/android/app/src/main/java/com/breez/client/plugins/breez/breezlib/GoogleAuthenticator.java
+++ b/android/app/src/main/java/com/breez/client/plugins/breez/breezlib/GoogleAuthenticator.java
@@ -90,22 +90,8 @@ public class GoogleAuthenticator implements PluginRegistry.ActivityResultListene
} catch (Exception e) {
Log.w(TAG, "getAccessToken failed", e);
if (e instanceof UserRecoverableAuthException) {
- Log.w(TAG, "getAccessToken failed but it is recoverable, trying to sign in again");
- GoogleSignInAccount signInResult = Tasks.await(signIn());
-
- try {
- credential.setSelectedAccount(signInResult.getAccount());
- } catch (Exception ex) {
- Log.w(TAG, "setSelectedAccount failed in recoverable", ex);
- throw ex;
- }
-
- try {
- return credential.getToken();
- } catch (Exception ex) {
- Log.w(TAG, "getAccessToken failed in recoverable", ex);
- throw ex;
- }
+ Log.w(TAG, "getAccessToken failed but it is recoverable, throw AuthError to try sign in again");
+ throw new Exception("AuthError");
}
throw e;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment