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

Fix TimeUnit function and TimeUnit2 function #9489

Merged
merged 1 commit into from
Jan 12, 2022
Merged

Conversation

y-tabata
Copy link
Contributor

Closes #9488

I fixed the following behavior.

  • When we set multiple of 24 to timeout of minutes, the admin console converts it and displays the timeout of days.

The TimeUnit2 function is for almost all timeouts, and the TimeUnit function is for example for brute force protection.

Copy link
Contributor

@tnorimat tnorimat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@y-tabata I've reviewed this PR and added one comment. Could you check it?

time = time / 60;
if (time % 24 == 0) {
unit = 'Days'
time = time / 24;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the line time = time / 24; needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left it because it existed in the original logic, but I removed it because it is certainly unnecessary.

Copy link
Contributor

@tnorimat tnorimat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@jonkoops jonkoops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of the level of nesting, but the code does what it needs to do. LGTM 👍

@jonkoops jonkoops added area/admin/ui kind/bug Categorizes a PR related to a bug labels Jan 11, 2022
@hmlnarik hmlnarik merged commit 1ff558b into keycloak:main Jan 12, 2022
@y-tabata y-tabata deleted the #9488 branch January 12, 2022 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/admin/ui kind/bug Categorizes a PR related to a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting "24 mins" to timeout, the admin console displays "1 day"
4 participants