File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
auth/src/main/java/com/firebase/ui/auth Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,13 @@ public void setAuthenticationCallback(IDPCallback callback) {
8787 mIDPCallback = callback ;
8888 }
8989
90+ public void disconnect () {
91+ if (mGoogleApiClient != null ) {
92+ mGoogleApiClient .disconnect ();
93+ mGoogleApiClient = null ;
94+ }
95+ }
96+
9097 private IDPResponse createIDPResponse (GoogleSignInAccount account ) {
9198 Bundle response = new Bundle ();
9299 response .putString (TOKEN_KEY , account .getIdToken ());
Original file line number Diff line number Diff line change @@ -180,6 +180,18 @@ public void onClick(View view) {
180180 }
181181 }
182182
183+ @ Override
184+ protected void onDestroy () {
185+ super .onDestroy ();
186+ if (mIdpProviders != null ) {
187+ for (final IDPProvider provider : mIdpProviders ) {
188+ if (provider instanceof GoogleProvider ) {
189+ ((GoogleProvider ) provider ).disconnect ();
190+ }
191+ }
192+ }
193+ }
194+
183195 public static Intent createIntent (
184196 Context context ,
185197 FlowParameters flowParams ) {
You can’t perform that action at this time.
0 commit comments