Fix: refresh_token now gets updated correctly

A refresh token in the response incorrectly set the access token with
the received value.
This commit is contained in:
Gergely Polonkai 2016-01-12 11:25:58 +01:00
parent b71bb84920
commit 5351f657fc

View File

@ -346,7 +346,7 @@ i_set_refresh_token(MatrixAPI *api, const gchar *refresh_token)
MATRIX_HTTP_API(api)); MATRIX_HTTP_API(api));
g_free(priv->refresh_token); g_free(priv->refresh_token);
priv->token = g_strdup(refresh_token); priv->refresh_token = g_strdup(refresh_token);
} }
static const gchar * static const gchar *
@ -470,8 +470,7 @@ _response_callback(SoupSession *session,
if ((refresh_token = json_node_get_string(node)) != NULL) { if ((refresh_token = json_node_get_string(node)) != NULL) {
g_debug("Got new refresh token: %s", refresh_token); g_debug("Got new refresh token: %s", refresh_token);
i_set_refresh_token(MATRIX_API(api), i_set_refresh_token(MATRIX_API(api), refresh_token);
refresh_token);
} }
} }