okta / okta-react

Okta OIDC SDK for React
https://github.com/okta/okta-react
Other
117 stars 78 forks source link

disableHttpsCheck is not a valid TypeScript option #268

Open eddiemonge opened 1 year ago

eddiemonge commented 1 year ago

Describe the bug

The examples for React Router 6 include disableHttpsCheck as an option in the examples, such as this one https://github.com/okta/okta-react/blob/master/samples/routing/react-router-dom-v6/src/config.ts. However, copying that file and adding a type to the config produces a type error.

image

Reproduction Steps?

Copy this config file and run TypeScript type check

import OktaAuth, { OktaAuthOptions } from '@okta/okta-auth-js';

const CLIENT_ID = process.env.CLIENT_ID || '{clientId}';
const ISSUER =
  process.env.ISSUER || 'https://{yourOktaDomain}.com/oauth2/default';
const OKTA_TESTING_DISABLEHTTPSCHECK =
  process.env.OKTA_TESTING_DISABLEHTTPSCHECK || false;
const BASENAME = process.env.PUBLIC_URL || '';
const REDIRECT_URI = `${window.location.origin}${BASENAME}/login/callback`;

const config = {
  oidc: {
    clientId: CLIENT_ID,
    disableHttpsCheck: OKTA_TESTING_DISABLEHTTPSCHECK,
    issuer: ISSUER,
    pkce: true,
    redirectUri: REDIRECT_URI,
    scopes: ['openid', 'profile', 'email'],
  } satisfies OktaAuthOptions,
};

SDK Versions

  System:
    OS: macOS 13.5.2
    CPU: (10) arm64 Apple M1 Max
    Memory: 134.92 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.6.0 - ~/.config/nvm/versions/node/v20.6.0/bin/node
    npm: 10.0.0 - ~/.config/nvm/versions/node/v20.6.0/bin/npm
  Browsers:
    Chrome: 117.0.5938.92
    Safari: 16.6
  npmPackages:
    @okta/okta-auth-js: ^7.3.0 => 7.4.2 
    @okta/okta-react: ^6.7.0 => 6.7.0 
    react: ^18.2.0 => 18.2.0 
    react-dom: ^18.2.0 => 18.2.0 
    react-router-dom: ^6.4.0 => 6.16.0 

Additional Information

No response