okta-signin-widget
okta-signin-widget copied to clipboard
Types missing defaultCountryCode in WidgetOptions
Describe the bug
Specifying a defaultCountryCode parameter in a WidgetOptions object to provide to OktaSignIn yields a TypeScript error:
Object literal may only specify known properties, and 'defaultCountryCode' does not exist in type 'WidgetOptions'.ts(2322)
What is expected to happen?
The option appears to still be supported by the application, so should be present on the type definition.
What is the actual behavior?
The type error as described is thrown.
Reproduction Steps
In a TS project, define a container for your options, like
let config: WidgetOptions
Attempt to define defaultCountryCode
as a property
config.defaultCountryCode = 'EN'
Observe type error reported for attempting to assign to defaultCountryCode:
Property 'defaultCountryCode' does not exist on type 'WidgetOptions'.ts(2339)
SDK Versions
- @okta/okta-angular 5.2.0
- @okta/okta-auth-js 6.7.5
- @okta/okta-signin-widget 6.6.2
Execution Environment
Angular SPA
Additional Information?
No response
I am working around this for now by specifying the container type as:
oktaConfig: WidgetOptions & { defaultCountryCode: string; }
Thanks for pointing this out. Internal ref: OKTA-573017