Skip to content
This repository has been archived by the owner on Jan 26, 2025. It is now read-only.

Fixed two issues when responseType is id_token only: #18

Closed
wants to merge 1 commit into from
Closed

Fixed two issues when responseType is id_token only: #18

wants to merge 1 commit into from

Conversation

jasgrg
Copy link

@jasgrg jasgrg commented Sep 29, 2017

When responseType is set to id_token only there are two issues.

  1. handleAuthentication is expecting the tokens variable to be an array, but it is an object. If it is an object then the call to forEach results in an unhandled exception. To prevent this, first check if the tokens is an array and if not create a new array with the tokens as the only entry.
  2. if an access_token was not requested, then isAuthenticated will always return false even if a valid id_token is returned. To handle this case, check for either access_token or idToken inside isAuthenticated.

1. Check to make sure that tokens is an array before calling .forEach inside handleAuthentication
2. Return true for isAuthenticated if either an access_token or an id_token exists
@jmelberg-okta
Copy link
Contributor

Thanks for the PR @jasgrg! We are currently working on a few patches and plan to merge this in shortly.

@jmelberg-okta
Copy link
Contributor

This fix has been included with the 1.0.0 release of @okta/okta-angular See #157 and #167 for more details!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants