[gnome-software] trivial: Don't throw a warning if we try to autenticate twice
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Don't throw a warning if we try to autenticate twice
- Date: Wed, 7 Sep 2016 15:31:10 +0000 (UTC)
commit 0260da2e9a685f6f2fe271f5541d7b34728185f2
Author: Richard Hughes <richard hughsie com>
Date: Wed Sep 7 15:13:50 2016 +0100
trivial: Don't throw a warning if we try to autenticate twice
src/plugins/gs-plugin-dummy.c | 23 +++++++----------------
1 files changed, 7 insertions(+), 16 deletions(-)
---
diff --git a/src/plugins/gs-plugin-dummy.c b/src/plugins/gs-plugin-dummy.c
index d2ded6f..cb353f4 100644
--- a/src/plugins/gs-plugin-dummy.c
+++ b/src/plugins/gs-plugin-dummy.c
@@ -704,14 +704,9 @@ gs_plugin_auth_login (GsPlugin *plugin, GsAuth *auth,
gs_auth_get_provider_id (priv->auth)) != 0)
return TRUE;
- /* already done */
- if (priv->has_auth) {
- g_set_error (error,
- GS_PLUGIN_ERROR,
- GS_PLUGIN_ERROR_FAILED,
- "authentication already done");
- return FALSE;
- }
+ /* already logged in */
+ if (priv->has_auth)
+ return TRUE;
/* check username and password */
if (g_strcmp0 (gs_auth_get_username (priv->auth), "dummy") != 0 ||
@@ -740,14 +735,10 @@ gs_plugin_auth_logout (GsPlugin *plugin, GsAuth *auth,
gs_auth_get_provider_id (priv->auth)) != 0)
return TRUE;
- /* not done */
- if (!priv->has_auth) {
- g_set_error (error,
- GS_PLUGIN_ERROR,
- GS_PLUGIN_ERROR_FAILED,
- "authentication not already done");
- return FALSE;
- }
+ /* not logged in */
+ if (!priv->has_auth)
+ TRUE;
+
priv->has_auth = FALSE;
gs_auth_set_flags (priv->auth, 0);
g_debug ("dummy now not authenticated");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]