Skip to content
This repository has been archived by the owner on Feb 25, 2019. It is now read-only.

authorizedScope, allow for no role scopes #328

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ikb42
Copy link

@ikb42 ikb42 commented Apr 7, 2016

not allowing for this case can cause a crash

not allowing for this case can cause a crash
@christiansmith
Copy link
Member

@ikb42 can you describe what's happening in a little more detail? I'm not sure I understand "no role scopes". We're handling these "unassigned" scopes in Scope.determine() method:

https://github.com/anvilresearch/connect/blob/master/models/Scope.js#L46-L85

@ikb42
Copy link
Author

ikb42 commented Apr 8, 2016

In the case that the subject client has been assigned a role but the role has no permitted scopes.
If this subject and a scope is then passed to Scope.determine, then subject.authorizedScope will return [ undefined ] which will then crash in Scope.determine on line found = found || (result.indexOf(scope.name) !== -1).

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