okta / okta-signin-widget

HTML/CSS/JS widget that provides out-of-the-box authentication UX for your organization's apps
Other
376 stars 319 forks source link

Custom button i18nKey configuration does not display button text as expected #2327

Open kaite2 opened 2 years ago

kaite2 commented 2 years ago

I'm submitting a

Background info

When using the following code to configure a custom button the i18nKey is not setting the button text it shows as an empty button. When testing in other versions available in OIE tenant

var config = OktaUtil.getSignInWidgetConfig();

config.i18n = {
    'en': {
      'customButton.createAccount': 'Create an account',
    }
};
config.customButtons = [{
    i18nKey: 'customButton.createAccount',
    className: 'button-registration',
    click: function () {
      window.location.href = 'https://www.google.com';
    }
}];

image

Expected behavior

I would expect the button text that is defined as i18nKey customButton.createAccount to appear in the button.

image

What went wrong?

Button text does not appear for custom buttons configured with i18nKey.

Steps to reproduce

I followed the instructions here: https://github.com/okta/okta-signin-widget#custom-buttons.

Your environment

denysoblohin-okta commented 2 years ago

Thanks for reporting this issue. Internal ref: OKTA-454191

denysoblohin-okta commented 2 years ago

Looks like fix is change

https://github.com/okta/okta-signin-widget/blob/bd037bc5c8814ffa08b415f748223e7bd87b6bfe/src/v2/view-builder/internals/FormInputFactory.js#L210 to

title: customButton.title || loc(customButton.i18nKey),