okta-signin-widget icon indicating copy to clipboard operation
okta-signin-widget copied to clipboard

Types missing defaultCountryCode in WidgetOptions

Open stephen-dirtcreative opened this issue 2 years ago • 2 comments

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

stephen-dirtcreative avatar Aug 18 '22 22:08 stephen-dirtcreative

I am working around this for now by specifying the container type as: oktaConfig: WidgetOptions & { defaultCountryCode: string; }

stephen-dirtcreative avatar Aug 18 '22 22:08 stephen-dirtcreative

Thanks for pointing this out. Internal ref: OKTA-573017

denysoblohin-okta avatar Feb 01 '23 17:02 denysoblohin-okta