[epiphany/wip/ephy-sync: 118/126] sync-service: Clear storage credentials at sign out



commit 523dc4442e78cf44a6b579b2a2af237714b35e92
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date:   Sat Aug 13 16:54:34 2016 +0300

    sync-service: Clear storage credentials at sign out

 src/ephy-sync-service.c |   24 ++++++++++++------------
 src/ephy-sync-service.h |    2 ++
 src/prefs-dialog.c      |    1 +
 3 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/src/ephy-sync-service.c b/src/ephy-sync-service.c
index 179b1b6..4e4be6b 100644
--- a/src/ephy-sync-service.c
+++ b/src/ephy-sync-service.c
@@ -188,18 +188,6 @@ destroy_session_response_cb (SoupSession *session,
   g_object_unref (parser);
 }
 
-static void
-ephy_sync_service_clear_storage_credentials (EphySyncService *self)
-{
-  g_return_if_fail (EPHY_IS_SYNC_SERVICE (self));
-
-  g_clear_pointer (&self->certificate, g_free);
-  g_clear_pointer (&self->storage_endpoint, g_free);
-  g_clear_pointer (&self->storage_credentials_id, g_free);
-  g_clear_pointer (&self->storage_credentials_key, g_free);
-  self->storage_credentials_expiry_time = 0;
-}
-
 static gboolean
 ephy_sync_service_storage_credentials_is_expired (EphySyncService *self)
 {
@@ -826,6 +814,18 @@ ephy_sync_service_set_and_store_tokens (EphySyncService          *self,
 }
 
 void
+ephy_sync_service_clear_storage_credentials (EphySyncService *self)
+{
+  g_return_if_fail (EPHY_IS_SYNC_SERVICE (self));
+
+  g_clear_pointer (&self->certificate, g_free);
+  g_clear_pointer (&self->storage_endpoint, g_free);
+  g_clear_pointer (&self->storage_credentials_id, g_free);
+  g_clear_pointer (&self->storage_credentials_key, g_free);
+  self->storage_credentials_expiry_time = 0;
+}
+
+void
 ephy_sync_service_delete_all_tokens (EphySyncService *self)
 {
   g_clear_pointer (&self->uid, g_free);
diff --git a/src/ephy-sync-service.h b/src/ephy-sync-service.h
index 8dd043b..3c5d63e 100644
--- a/src/ephy-sync-service.h
+++ b/src/ephy-sync-service.h
@@ -60,6 +60,8 @@ void             ephy_sync_service_set_and_store_tokens         (EphySyncService
                                                                  EphySyncServiceTokenType  token_type,
                                                                  ...) G_GNUC_NULL_TERMINATED;
 
+void            ephy_sync_service_clear_storage_credentials     (EphySyncService *self);
+
 void             ephy_sync_service_delete_all_tokens            (EphySyncService *self);
 
 void             ephy_sync_service_destroy_session              (EphySyncService *self,
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 0c667c7..70164b9 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -358,6 +358,7 @@ on_sync_sign_out_button_clicked (GtkWidget   *button,
 
   /* Destroy session and delete tokens. */
   ephy_sync_service_destroy_session (service, sessionToken);
+  ephy_sync_service_clear_storage_credentials (service);
   ephy_sync_service_delete_all_tokens (service);
   ephy_sync_secret_forget_all_tokens ();
   ephy_sync_service_set_user_email (service, NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]