myartsev / ember-simple-auth-jwt

Ember Simple Auth extension for JWT
MIT License
9 stars 3 forks source link

Improve _validate to check time stamps #10

Closed matthewvalimaki closed 7 years ago

matthewvalimaki commented 7 years ago

This is minor but took some time from me to figure out. For example if exp is not a number containing a NumericDate value then _scheduleAccessTokenRefresh will go into an indefinite loop because of (expiresAt * 1000) will be NaN. Perhaps a simple numeric check in _validate would be sufficient.

myartsev commented 7 years ago

Any integer is technically a valid UNIX epoch time so it must have been something other than an integer? What was the value that you had exp set to?

matthewvalimaki commented 7 years ago

It was long format of UTC. So noticing that took me a while. I simply forgot to make it integer.

myartsev commented 7 years ago

Gotcha!

myartsev commented 7 years ago

23602cf should take care of it!