Skip to content

Commit

Permalink
[buteo-sync-plugins-social] Don't pass oauth token as key query param…
Browse files Browse the repository at this point in the history
…eter. Contributes to JB#50140

Google calendar sync recently started (intermittently) failing.
I believe the reason is that for some API endpoints, Google now
requires an API specific key to be passed as a query parameter,
aside from the oauth2 token which is passed in the authorization
header.  Even though the Calendar API is not one of the APIs which
requires this type of API key, passing the oauth2 token as a key
parameter was causing issues.

This commit ensures we don't pass the token as a query parameter.
It is already provided in the authorization header.
  • Loading branch information
Chris Adams committed Jun 15, 2020
1 parent ec68dec commit 38136c3
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/google/google-calendars/googlecalendarsyncadaptor.cpp
Expand Up @@ -1214,7 +1214,6 @@ void GoogleCalendarSyncAdaptor::beginSync(int accountId, const QString &accessTo
void GoogleCalendarSyncAdaptor::requestCalendars(int accountId, const QString &accessToken, bool needCleanSync, const QString &pageToken)
{
QList<QPair<QString, QString> > queryItems;
queryItems.append(QPair<QString, QString>(QString::fromLatin1("key"), accessToken));
if (!pageToken.isEmpty()) { // continuation request
queryItems.append(QPair<QString, QString>(QString::fromLatin1("pageToken"),
pageToken));
Expand Down Expand Up @@ -1438,7 +1437,6 @@ void GoogleCalendarSyncAdaptor::requestEvents(int accountId, const QString &acce
}

QList<QPair<QString, QString> > queryItems;
queryItems.append(QPair<QString, QString>(QString::fromLatin1("key"), accessToken));
if (!needCleanSync) { // delta update request
queryItems.append(QPair<QString, QString>(QString::fromLatin1("syncToken"), syncToken));
} else { // clean sync request
Expand Down

0 comments on commit 38136c3

Please sign in to comment.