You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I would like to know when an code exchange error could be solved by synchronizing the host clock (90% of the problems my users have), but checking the error for error.message.startsWith('JWT expired, now') is a bit too hacky.
Describe the solution you'd like
Add the property code for the RPerror class with a small, likely stable, string indicating the issue.
Examples: jwt_nbf_invalid, jwt_expired.
Alternatively, you could add the an CLOCK_TOLERANCE property to any error that is related to this variable.
Describe alternatives you've considered
Checking for the error message doesn't seems to stable;
Reading the error.jwt and re-checking those cases is redundant;
Adding some NTP client lib to make sure the clock is updated is too much of an overhead;
Telling my users to update their clocks on every Code Exchange error;
Additional context
My open source project is very very often deployed on windows servers right after deployment, with some atrocious clocks.
i have searched the issues tracker on github for similar requests and couldn't find anything related.
The text was updated successfully, but these errors were encountered:
Is it safe to say you want to be able to identify these four specific errors?
printf: ['too much time has elapsed since the last End-User authentication, max_age %i, auth_time: %i, now %i', maxAge, payload.auth_time, timestamp - this[CLOCK_TOLERANCE]],
printf: ['JWT issued too far in the past, now %i, iat %i', timestamp, payload.iat],
printf: ['JWT not active yet, now %i, nbf %i', timestamp + this[CLOCK_TOLERANCE], payload.nbf],
printf: ['JWT expired, now %i, exp %i', timestamp - this[CLOCK_TOLERANCE], payload.exp],
Would be awesome to have code for all errors, since I would also like to handle timeout errors more gracefully, but those are more "edge cases".
Having an error code (or some other identifier) for those 4 would certainly help me out a lot!
And as always, thanks for the responsiveness @panva!
Is your feature request related to a problem? Please describe.
I would like to know when an code exchange error could be solved by synchronizing the host clock (90% of the problems my users have), but checking the error for
error.message.startsWith('JWT expired, now')
is a bit too hacky.Describe the solution you'd like
Add the property
code
for the RPerror class with a small, likely stable, string indicating the issue.Examples:
jwt_nbf_invalid
,jwt_expired
.Alternatively, you could add the an
CLOCK_TOLERANCE
property to any error that is related to this variable.Describe alternatives you've considered
error.jwt
and re-checking those cases is redundant;Additional context
My open source project is very very often deployed on windows servers right after deployment, with some atrocious clocks.
The text was updated successfully, but these errors were encountered: