Skip to content
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

feature request: standardize time units #6231

Open
ggomarighetti opened this issue Jul 12, 2024 · 3 comments
Open

feature request: standardize time units #6231

ggomarighetti opened this issue Jul 12, 2024 · 3 comments
Labels
feature-request Something cool or not cool

Comments

@ggomarighetti
Copy link

What problem did you meet?

The time units, more specifically, the access-token and refresh-token units differ, the former being in "seconds" and the latter in "days". Using different scales or time measurements for something that perhaps should or could be standardized.

Describe what you'd like Logto to have

I propose either to adapt a standardized unit of time, such as the seconds used in the access token, or, as a more complex alternative, to leave the validation only of integers and add formatting to the values using day, hour, minute, second, for example, that the end user enters in the Logto console "1d12h30m30s" equivalent in an integer value to 131430 seconds.

@ggomarighetti ggomarighetti changed the title feature request: feature request: standardize time units Jul 12, 2024
@wangsijie
Copy link
Contributor

Good suggestion! I'll discuss with the team.

@wangsijie wangsijie added the feature-request Something cool or not cool label Jul 25, 2024
@xiaohanyu
Copy link
Contributor

Hello, I think the time format has another issue, i.e, created_at, updated_at in JWT claims use milliseconds, while exp, iat use seconds, which would confuse user when deal cases such as membership expiration logic.

Evidence:

image

It would be better if we could unify all time format (either in seconds or in milliseconds). I guess this would need some kind of production data migration work right? Not as easy as it may look like.

@ggomarighetti
Copy link
Author

I was not referring to the exact value that is reflected in the tokens, but rather, that in the use of the platform (at least by user-interface) to refer to the expiration date of the accessTokens is asked to enter seconds (or minutes, I do not remember well) and for the refreshToken is asked to enter days as an integer, being that both are expressed as seconds or milliseconds in their respective claims, and as there can be tokens that last 5 minutes as well as others that last 1 year, it seems to me that using a format like the one proposed in the inputs (at least in the frontend) for the users to express the time and then apply a utility to convert it to seconds or milliseconds, would be ideal or more convenient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Something cool or not cool
Development

No branches or pull requests

3 participants