Skip to content

Commit

Permalink
Fix for #64?
Browse files Browse the repository at this point in the history
  • Loading branch information
okrad committed Dec 13, 2021
1 parent f1bc83d commit 67e00c3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/src/token_storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ class TokenStorage {
found = (tkn['scope'] == null || tkn['scope'].isEmpty);
} else {
//...Otherwise look for a token granted to a superset of the requested scopes
final tknCleanScopes = clearScopes(tkn['scope'].cast<String>());

if (tknCleanScopes.isNotEmpty) {
var s1 = Set.from(tknCleanScopes);
var s2 = Set.from(cleanScopes);
found = s1.intersection(s2).length == cleanScopes.length;
if (tkn.containsKey('scope')) {
final tknCleanScopes = clearScopes(tkn['scope'].cast<String>());

if (tknCleanScopes.isNotEmpty) {
var s1 = Set.from(tknCleanScopes);
var s2 = Set.from(cleanScopes);
found = s1.intersection(s2).length == cleanScopes.length;
}
}
}

Expand Down

0 comments on commit 67e00c3

Please sign in to comment.