capacitor-community / generic-oauth2

Generic Capacitor OAuth 2 client plugin. Stop the war in Ukraine!
MIT License
223 stars 106 forks source link

Bug: OAuth2AuthenticateOptions during test #202

Open shifenis opened 2 years ago

shifenis commented 2 years ago

Capacitor version:

Run npx cap doctor:

πŸ’Š   Capacitor Doctor  πŸ’Š

Latest Dependencies:

  @capacitor/cli: 3.4.3
  @capacitor/core: 3.4.3
  @capacitor/android: 3.4.3
  @capacitor/ios: 3.4.3

Installed Dependencies:

  @capacitor/core: 3.4.0
  @capacitor/cli: 3.4.0
  @capacitor/android: 3.4.0
  @capacitor/ios: 3.4.0

[success] iOS looking great! πŸ‘Œ
[success] Android looking great! πŸ‘Œ

Library version:

^3.0.1

OAuth Provider:

Azure AD (B2C)

Your Plugin Configuration

  private readonly configuration: OAuth2AuthenticateOptions = {
    appId: `appId`,
    authorizationBaseUrl: `authorize`,
    scope: myScope,
    accessTokenEndpoint: `accessTokenUri`,
    resourceUrl: null,
    responseType: "code",
    pkceEnabled: true,
    additionalParameters: {
      prompt: "select_account",
    },
    web: {
      redirectUrl: `myRedirect`,
    },
    android: {
      redirectUrl: "uri",
    },
    ios: {
      pkceEnabled: true,
      redirectUrl: "uri",
    },
  } ;

Current Behavior

The problem is present when adding additionalParameters and running npx ng test with .spec that contains some test on that file it runs:

Object literal may only specify known properties, and 'additionalParameters' does not exist in type 'OAuth2AuthenticateOptions'

Even if the interface is correctly extended.

Expected Behavior

The test should run.

Reproduction Steps

  1. Add configuration
  2. additionalParameters object
  3. run npx ng test