[evolution-data-server/gnome-3-22] Unable to add additional Google calendar
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-22] Unable to add additional Google calendar
- Date: Mon, 6 Feb 2017 10:25:09 +0000 (UTC)
commit a2ab1e9d044167f207ce2494a6fbeaa86f80d465
Author: Milan Crha <mcrha redhat com>
Date: Mon Feb 6 11:26:42 2017 +0100
Unable to add additional Google calendar
There was no credentials prompt when using Google authentication (OAuth2),
only an error about secret not found had been shown. This fixes it and
lets the user to enter Google credentials when not found in the keyring.
Reported downstream as:
https://bugzilla.redhat.com/show_bug.cgi?id=1418915
.../e-source-credentials-provider-impl-google.c | 9 ++++++++-
libedataserverui/e-webdav-discover-widget.c | 1 +
2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/libedataserver/e-source-credentials-provider-impl-google.c
b/libedataserver/e-source-credentials-provider-impl-google.c
index b3642e2..e333cfa 100644
--- a/libedataserver/e-source-credentials-provider-impl-google.c
+++ b/libedataserver/e-source-credentials-provider-impl-google.c
@@ -398,10 +398,17 @@ e_source_credentials_google_refresh_token_sync (ESource *source,
secret = e_named_parameters_get (credentials, E_SOURCE_CREDENTIAL_GOOGLE_SECRET);
if (!secret) {
- g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Failed to get Google secret
from credentials"));
+ if (error && !*error)
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Failed to get Google
secret from credentials"));
+
return FALSE;
}
+ /* The caller can have set an error from the secret lookup,
+ which are propagated, but otherwise a success is reported. */
+ if (error && *error)
+ g_clear_error (error);
+
if (!e_source_credentials_google_util_decode_from_secret (secret, E_GOOGLE_SECRET_REFRESH_TOKEN,
&refresh_token, NULL) ||
!refresh_token || !*refresh_token) {
g_free (refresh_token);
diff --git a/libedataserverui/e-webdav-discover-widget.c b/libedataserverui/e-webdav-discover-widget.c
index 0aab6bc..984455f 100644
--- a/libedataserverui/e-webdav-discover-widget.c
+++ b/libedataserverui/e-webdav-discover-widget.c
@@ -723,6 +723,7 @@ e_webdav_discover_content_refresh_done_cb (GObject *source_object,
rd = NULL;
} else if (g_cancellable_is_cancelled (rd->cancellable) ||
(!g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED) &&
+ !g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) &&
!g_error_matches (local_error, SOUP_HTTP_ERROR, SOUP_STATUS_UNAUTHORIZED) &&
!g_error_matches (local_error, SOUP_HTTP_ERROR, SOUP_STATUS_FORBIDDEN))) {
g_simple_async_result_take_error (rd->simple, local_error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]