ng-oidc-client: clientSettings.userStore не является функцией - PullRequest
0 голосов
/ 01 октября 2019

Следуя инструкции , я получаю clientSettings.userStore is not a function при загрузке страницы.

Я скопировал объект oidc_config и просто изменил полномочия:

StoreModule.forRoot({}),
EffectsModule.forRoot([]),
NgOidcClientModule.forRoot({
    oidc_config: {
        authority: 'http://localhost:49853/',
        client_id: 'ng-oidc-client-identity',
        redirect_uri: 'http://localhost:49853/callback.html',
        response_type: 'id_token token',
        scope: 'openid profile offline_access api1',
        post_logout_redirect_uri: 'http://localhost:49853/signout-callback.html',
        silent_redirect_uri: 'http://localhost:49853/renew-callback.html',
        accessTokenExpiringNotificationTime: 10,
        automaticSilentRenew: true,
        userStore: new WebStorageStateStore({ store: window.localStorage })
    },
    log: {
        logger: console,
        level: Log.NONE
    }
})

И добавил соответствующие файлы ресурсов:

    "assets": [
      "src/favicon.ico",
      "src/assets",
      {
        "glob": "**/*",
        "input": "src/static",
        "output": "/"
      },
      {
        "glob": "oidc-client.min.js",
        "input": "node_modules/oidc-client/dist",
        "output": "/"
      }
    ],

версии:

"@ngrx/effects": "7.4.0",
"@ngrx/store": "7.4.0",
"ng-oidc-client": "1.0.5",
"oidc-client": "^1.9.1"

stackblitz

Я пытался возиться с управлением версиями, так как я запускаю Angular 7, но npm по умолчанию устанавливает зависимости на 8. Однако, похоже, ничего не происходитработает до сих пор.

...