[evolution-data-server/gnome-3-26] Internal Google OAuth2 token not refreshed on calendar open



commit 8ce315de336dc0f44cae37f48c1a29c988b5bd5b
Author: Milan Crha <mcrha redhat com>
Date:   Mon Oct 9 12:59:54 2017 +0200

    Internal Google OAuth2 token not refreshed on calendar open
    
    While the token can be refreshed on demand, it was not done due to the code
    considering expired tokens as unusable. That's partly true, except the code
    can refresh information when the secret is available. The change sets
    at least the stored secret even when the token is expired, which makes
    it refresh the token on demand, as is expected.

 .../e-source-credentials-provider-impl-google.c    |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/libedataserver/e-source-credentials-provider-impl-google.c 
b/src/libedataserver/e-source-credentials-provider-impl-google.c
index 9867df4..21a7f2c 100644
--- a/src/libedataserver/e-source-credentials-provider-impl-google.c
+++ b/src/libedataserver/e-source-credentials-provider-impl-google.c
@@ -108,11 +108,11 @@ e_source_credentials_google_util_get_access_token_from_secret (const gchar *secr
                NULL))
                return FALSE;
 
-       if (access_token && expires_after &&
-           g_ascii_strtoll (expires_after, NULL, 10) > g_get_real_time () / G_USEC_PER_SEC) {
+       if (access_token && expires_after) {
                success = TRUE;
 
-               if (out_access_token) {
+               if (out_access_token &&
+                   g_ascii_strtoll (expires_after, NULL, 10) > g_get_real_time () / G_USEC_PER_SEC) {
                        *out_access_token = access_token;
                        access_token = NULL;
                }


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