-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
actionUser expiry
field cannot be set to "infinity" (9223372036854775807)
#43
Comments
It looks like you might have a typo. The docs state that the max value is Let me know if I'm missing something on this issue though. |
It is easy to check this by using your own local That's really the JavaScript/TypeScript problem mentioned there: (this is unique to JS platform and not a problem with Java, Python, etc.)
|
Ah. Got it now. That's quite the limitation of the JS system and it makes no sense that the system would be rounding UP. That's just crazy talk. Honestly, I've never been a huge fan of using I did a quick review of the code and it appears that using a value such as |
@voidmain I do agree that expiry == null should mean infinite. But definitely null never means 0 here, as an expiry of 0 don't make sense. It's still practical to follow your suggestion of a large-enough instant, as for all practical reasons the user would've already been dead anyway by the time his/her user account restriction is lifted. ^_^ (unless his grand-grand-grand-grand-grandchildren cares enough to continue the trolling, hehe) Update: I just found out the max instant is the year 1000000000. So that's a lot of grandchildren to pass the FusionAuth user account to. ;-) (it'd be cool if someone still uses FusionAuth by then ^_^) |
Reference: https://fusionauth.io/docs/v1/tech/apis/actioning-users/#take-an-action-on-a-user
Since Java API uses
Long
and theexpiry
field TypeScript definition usesnumber
, trying to use that number literal will give TypeScript warning "Numeric literals with absolute values equal to 2^53 or greater are too large to be represented accurately as integers.ts(80008)"And also when executing the result is:
Workaround
Use:
'9223372036854775807' as any
Proposed Solution
If possible, change the type to
number | string | undefined
which is probably a good-enough compromise retaining backwards compatibility.If not possible, then
string | undefined
is more flexible.The text was updated successfully, but these errors were encountered: