Skip to content

Commit

Permalink
misc: use typeof checking
Browse files Browse the repository at this point in the history
  • Loading branch information
embbnux committed Oct 12, 2023
1 parent 6616f8c commit 70cb9a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sdk/src/platform/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ export default class Auth {
...data,
...newData,
};
if (newData.expires_in && !newData.expire_time) {
if (typeof newData.expires_in !== 'undefined' && !newData.expire_time) {
savedData.expire_time = Date.now() + parseInt(newData.expires_in, 10) * 1000;
}
if (newData.refresh_token_expires_in && !newData.refresh_token_expire_time) {
if (typeof newData.refresh_token_expires_in !== 'undefined' && !newData.refresh_token_expire_time) {
savedData.refresh_token_expire_time = Date.now() + parseInt(newData.refresh_token_expires_in, 10) * 1000;
}
await this._cache.setItem(this._cacheId, savedData);
Expand Down

0 comments on commit 70cb9a0

Please sign in to comment.