Skip to content

Commit

Permalink
Trim witespace from front/back of access ID and secret. Should fix is…
Browse files Browse the repository at this point in the history
…sue #114
  • Loading branch information
dkerr64 committed Jan 29, 2025
1 parent 8a5c509 commit a75f6a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/yolinkAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ export class YoLinkAPI {
const timestamp = new Date().getTime();
const params = new URLSearchParams();
params.append('grant_type', 'client_credentials');
params.append('client_id', platform.config.userAccessId);
params.append('client_secret', platform.config.secretKey);
params.append('client_id', platform.config.userAccessId.trim());
params.append('client_secret', platform.config.secretKey.trim());
platform.verboseLog('SENDING:\n' + params);
let response = await fetch(platform.config.tokenURL, { method: 'POST', body: params });
checkHttpStatus(response);
Expand Down Expand Up @@ -261,7 +261,7 @@ export class YoLinkAPI {
platform.verboseLog('Current access token expired, or close to expiry, requesting new one');
const params = new URLSearchParams();
params.append('grant_type', 'refresh_token');
params.append('client_id', platform.config.userAccessId);
params.append('client_id', platform.config.userAccessId.trim());
// TEST with bad refresh token
params.append('refresh_token', this.yolinkTokens.refresh_token);
platform.verboseLog('SENDING:\n' + params);
Expand Down

0 comments on commit a75f6a3

Please sign in to comment.