Skip to content

Commit

Permalink
fix status in ipc response when mytoken request fails; fix #583
Browse files Browse the repository at this point in the history
  • Loading branch information
zachmann committed Aug 7, 2024
1 parent 3820fda commit 0f867e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/oidc-agent/mytoken/submytoken.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ char* get_submytoken(struct ipcPipe pipes, struct oidc_account* account,
secFreeJson(expires_in);
cJSON_AddNumberToObject(m, AGENT_KEY_EXPIRESAT, (double)expires_at);
}
setJSONValue(m, IPC_KEY_STATUS, STATUS_SUCCESS);
setJSONValue(m, IPC_KEY_STATUS,
jsonHasKey(m, OIDC_KEY_ERROR) ? STATUS_FAILURE : STATUS_SUCCESS);
setJSONValue(m, IPC_KEY_MYTOKEN_OIDC_ISS, account_getIssuerUrl(account));
setJSONValue(m, IPC_KEY_MYTOKEN_MY_ISS, account_getMytokenUrl(account));
char* r = jsonToStringUnformatted(m);
Expand Down

0 comments on commit 0f867e6

Please sign in to comment.