Skip to content

Conversation

@knoxjamesus
Copy link

Use this template to give context and details about what your changes bring to the project. You should complete as many sections as possible, deleting those that are not relevant.

Ticket 🎟

[XXX-xxx]


What ⁉️

What are these changes? Please include screenshots for UI changes
Fix error in isValidToken logic, both issued_at and expires_in are in seconds but compares to Date.getTime() which returns milliseconds
image

Why ⁉️

Why are these changes necessary?
Current isValidToken function causes a new token to be requested for each call.
Can result in 500 responses from API if too many requests per second

How ⁉️

How have you approached making these changes?
Divide Date.getTime() by 1000 to get seconds, and rename variables to understand what time interval the expiry is defined in

How to review and test 📱

Please provide details on how the reviewer should review your changes and the best way for them to test them.
Run two subsequent requests with API, should reuse the same token.


Checklist ✅

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests are passing locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant