Skip to content

Commit

Permalink
Merge pull request #42 from stijnbrouwers/bugfix/carepartner-login-400
Browse files Browse the repository at this point in the history
bugfix(carelink): Fix login error 400 when logging in as carepartner
  • Loading branch information
bewest authored Jun 8, 2023
2 parents 7c98977 + 54b61fe commit 73e1b01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion carelink.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ var Client = exports.Client = function (options) {
logger.log('GET data (as carepartner) ' + dataRetrievalUrl);
var body = {
username: options.username,
role: "carepartner"
role: "carepartner",
patientId: options.patientId
};
return await axiosInstance.post(dataRetrievalUrl,body,{

Expand Down
4 changes: 3 additions & 1 deletion run.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var config = {
maxRetryDuration: parseInt(readEnv('CARELINK_MAX_RETRY_DURATION', carelink.defaultMaxRetryDuration), 10),
verbose: !readEnv('CARELINK_QUIET', true),
deviceInterval: 5.1 * 60 * 1000,
patientId: readEnv('CARELINK_PATIENT'),
};

if (!config.username) {
Expand All @@ -43,7 +44,8 @@ if (!config.username) {
var client = carelink.Client({
username: config.username,
password: config.password,
maxRetryDuration: config.maxRetryDuration
maxRetryDuration: config.maxRetryDuration,
patientId: config.patientId
});
var entriesUrl = (config.nsBaseUrl ? config.nsBaseUrl : 'https://' + config.nsHost) + '/api/v1/entries.json';
var devicestatusUrl = (config.nsBaseUrl ? config.nsBaseUrl : 'https://' + config.nsHost) + '/api/v1/devicestatus.json';
Expand Down

0 comments on commit 73e1b01

Please sign in to comment.