Skip to content

54481: Fix: Added DuplicateUserLabel for OTP as i18n - #54492

Open
TheRealIndianBoi wants to merge 2 commits into
keycloak:mainfrom
TheRealIndianBoi:bug/54481
Open

TheRealIndianBoi wants to merge 2 commits into
keycloak:mainfrom
TheRealIndianBoi:bug/54481

Conversation

@TheRealIndianBoi

Copy link
Copy Markdown

Possible fix for #54481

Signed-off-by: TheRealIndianDev <100276261+therealindianboi@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the change making duplicate OTP device-name errors localizable.

No open issues 🎉

What changed in this PR

Addresses #54481 by making the duplicate OTP device-name error localizable through Keycloak’s login theme message bundles.

Changes:

  • Adds duplicateTotpDeviceNameMessage with an English default and a corresponding Java constant.
  • Uses the message key for duplicate OTP label errors.
  • Updates the existing test assertion to match the message’s trailing period.
File Description
themes/​src/​main/​resources/​theme/​base/​login/​messages/​messages_en.properties Adds the English default for the localizable error.
testsuite/​integration-arquillian/​tests/​base/​src/​test/​java/​org/​keycloak/​testsuite/​actions/​AppInitiatedActionTotpSetupTest.java Updates the expected error text.
services/​src/​main/​java/​org/​keycloak/​services/​messages/​Messages.java Defines the duplicate OTP device-name message constant.
services/​src/​main/​java/​org/​keycloak/​authentication/​requiredactions/​UpdateTotp.java Uses the message constant for duplicate label validation.

Review effort: Balanced

@mabartos mabartos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've tried to analyze more places like this, but they don't probably need the effort for now - could be done in a follow-up. Just one thing, otherwise LGTM.

…ions/UpdateTotp.java

Signed-off-by: Martin Bartoš <mabartos@redhat.com>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 11:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The duplicate OTP device-name localization change has no active review issues.

No open issues 🎉

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate OTP - Non-localizable error message “Device already exists with the same name”

3 participants