Skip to content

Commit

Permalink
Merge pull request #7 from kbulygin/expire-correction-sign
Browse files Browse the repository at this point in the history
Fix the sign of the tokenExpireIn correction
  • Loading branch information
alexstep authored Dec 30, 2022
2 parents 90d55e4 + 4a4b829 commit de4f89c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class NalogAPI {
* @returns {Promise(string)}
*/
async getToken () {
if (this.token && this.tokenExpireIn && new Date().getTime() - 60 * 1000 < new Date(this.tokenExpireIn).getTime()) {
if (this.token && this.tokenExpireIn && new Date().getTime() + 60 * 1000 < new Date(this.tokenExpireIn).getTime()) {
return this.token
}

Expand Down

0 comments on commit de4f89c

Please sign in to comment.