question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'split' of undefined ... OAuthService.storeAccessTokenResponse

See original GitHub issue

Hi,

Thanks a lot for the update to support Angular 6. However, after updating I get this error when I try to login:

ERROR TypeError: Cannot read property 'split' of undefined
    at OAuthService.push../node_modules/angular-oauth2-oidc/esm5/angular-oauth2-oidc.js.OAuthService.storeAccessTokenResponse (angular-oauth2-oidc.js:1039)
    at SafeSubscriber._next (angular-oauth2-oidc.js:625)
    at 

Here’s my config:

export const authConfig: AuthConfig = {
  issuer: 'http://localhost:5000',
  clientId: 'ngclient',
  dummyClientSecret: 'secret',
  scope: 'openid profile roles webApi offline_access',
  showDebugInformation: true,
  oidc: false
};

My token endpoint is only returning:

{
  access_token: 'eyJhbGciOiJSUz.....',
  expires_in : 3600,
  refresh_token: 'd4f06feb10391....',
  token_type : "Bearer"
}

Am I doing something wrong?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bechhansencommented, May 15, 2018

I have also seen this problem. The problems is already fixed in the https://www.npmjs.com/package/angular-oauth2-oidc-codeflow fork.

0reactions
manfredsteyercommented, May 15, 2018

Thanks for pointing this out and the PR. I’ve just published a new version 4.0.1 with a fix for this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot Read Property 'split' of Undefined - freeCodeCamp
it will throw the TypeError: Cannot read property 'split' of undefined error. The split method. When split is called on a string, it...
Read more >
How to prevent cannot read property split of ... - Meticulous
An article about the error 'cannot read property split of undefined' and various techniques to prevent it.
Read more >
OAuthService - angular-oauth2-oidc
Service for logging in and logging out with OIDC and OAuth2. Supports implicit flow and password flow. Extends. AuthConfig. Index. Properties.
Read more >
JWT Cannot read Property 'split' of undefined - Box Support
Hi Everyone, I'm trying to use the Node SDK for JWT Authentication in a React App (and using Webpack). I'm running into the...
Read more >
TypeError: Cannot read Property 'split' of Undefined in JS
The "Cannot read property 'split' of undefined" error occurs when trying to call the `split()` method on a variable that stores an `undefined`...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found