[gnome-online-accounts] owncloud: Set GOA_ERROR_NOT_AUTHORIZED if password is invalid



commit 9151b776dc5c03d04bee8cbac661231eb9f6bbcd
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Nov 5 13:42:06 2012 +0100

    owncloud: Set GOA_ERROR_NOT_AUTHORIZED if password is invalid
    
    Fixes: https://bugzilla.gnome.org/687632

 src/goabackend/goaowncloudprovider.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/goabackend/goaowncloudprovider.c b/src/goabackend/goaowncloudprovider.c
index 1935182..f3f1b4f 100644
--- a/src/goabackend/goaowncloudprovider.c
+++ b/src/goabackend/goaowncloudprovider.c
@@ -355,6 +355,21 @@ ensure_credentials_sync (GoaProvider         *provider,
                                     password,
                                     cancellable,
                                     error);
+  if (!ret)
+    {
+      if (error != NULL)
+        {
+          g_prefix_error (error,
+                          _("Invalid password with username `%s' (%s, %d): "),
+                          username,
+                          g_quark_to_string ((*error)->domain),
+                          (*error)->code);
+          (*error)->domain = GOA_ERROR;
+          (*error)->code = GOA_ERROR_NOT_AUTHORIZED;
+        }
+      goto out;
+    }
+
   if (out_expires_in != NULL)
     *out_expires_in = 0;
 



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