[gnome-software/wip/temp/ubuntu-xenial-rebased: 260/326] Add gs_ubuntuone_clear_macaroon ()
- From: Iain Lane <iainl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/temp/ubuntu-xenial-rebased: 260/326] Add gs_ubuntuone_clear_macaroon ()
- Date: Fri, 29 Apr 2016 10:09:12 +0000 (UTC)
commit 054bff4b937bfdb2c246fd622472c07494725ce2
Author: William Hua <william hua canonical com>
Date: Sun Apr 17 20:56:37 2016 -0400
Add gs_ubuntuone_clear_macaroon ()
src/plugins/gs-ubuntu-snapd.c | 2 ++
src/plugins/gs-ubuntuone.c | 6 ++++++
src/plugins/gs-ubuntuone.h | 2 ++
3 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-ubuntu-snapd.c b/src/plugins/gs-ubuntu-snapd.c
index aabc9a8..71d2368 100644
--- a/src/plugins/gs-ubuntu-snapd.c
+++ b/src/plugins/gs-ubuntu-snapd.c
@@ -168,6 +168,8 @@ send_snapd_request (gboolean authenticate,
if (code == 403 && retry_after_login) {
g_socket_close (socket, NULL);
+ gs_ubuntuone_clear_macaroon ();
+
macaroon = gs_ubuntuone_get_macaroon (FALSE, TRUE, NULL);
if (macaroon == NULL)
diff --git a/src/plugins/gs-ubuntuone.c b/src/plugins/gs-ubuntuone.c
index a0907fe..3c7b582 100644
--- a/src/plugins/gs-ubuntuone.c
+++ b/src/plugins/gs-ubuntuone.c
@@ -187,6 +187,12 @@ gs_ubuntuone_get_macaroon (gboolean use_cache,
return NULL;
}
+void
+gs_ubuntuone_clear_macaroon (void)
+{
+ secret_password_clear_sync (&schema, NULL, NULL, "key", MACAROON, NULL);
+}
+
typedef struct
{
GCancellable *cancellable;
diff --git a/src/plugins/gs-ubuntuone.h b/src/plugins/gs-ubuntuone.h
index 39bbd89..4e9fde8 100644
--- a/src/plugins/gs-ubuntuone.h
+++ b/src/plugins/gs-ubuntuone.h
@@ -30,6 +30,8 @@ GVariant *gs_ubuntuone_get_macaroon (gboolean use_cache,
gboolean show_dialog,
GError **error);
+void gs_ubuntuone_clear_macaroon (void);
+
gboolean gs_ubuntuone_get_credentials (gchar **consumer_key,
gchar **consumer_secret,
gchar **token_key,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]