Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-jy committed Nov 26, 2024
1 parent c5be612 commit b613860
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 0 additions & 7 deletions cpp/lib/Authenticator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,6 @@ extern "C" {
snowflake_cJSON_DeleteItemFromObject(data, "AUTHENTICATOR");
snowflake_cJSON_DeleteItemFromObject(data, "TOKEN");

if (AUTH_OAUTH == getAuthenticatorType(conn->authenticator))
{
snowflake_cJSON_AddStringToObject(body, "AUTHENTICATOR", SF_AUTHENTICATOR_OAUTH);
snowflake_cJSON_AddStringToObject(body, "TOKEN", conn->oauth_token);
}

if (!conn || !conn->auth_object)
{
return;
Expand All @@ -160,7 +154,6 @@ extern "C" {
try
{
jsonObject_t picoBody;
cJSON* data = snowflake_cJSON_GetObjectItem(body, "data");
cJSONtoPicoJson(data, picoBody);
static_cast<Snowflake::Client::IAuthenticator*>(conn->auth_object)->
updateDataMap(picoBody);
Expand Down
7 changes: 7 additions & 0 deletions lib/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,13 @@ cJSON *STDCALL create_auth_json_body(SF_CONNECT *sf,
// update authentication information to body
auth_update_json_body(sf, body);

if (AUTH_OAUTH == getAuthenticatorType(sf->authenticator))
{
data = snowflake_cJSON_GetObjectItem(body, "data");
snowflake_cJSON_AddStringToObject(data, "AUTHENTICATOR", SF_AUTHENTICATOR_OAUTH);
snowflake_cJSON_AddStringToObject(data, "TOKEN", sf->oauth_token);
}

return body;
}

Expand Down

0 comments on commit b613860

Please sign in to comment.