1
0
forked from baron/baron-sso
Files
baron-sso/userfront/lib/features/auth/domain/consent_scope_policy.dart

12 lines
390 B
Dart

bool isRefreshTokenScopeAlias(String scope) {
final normalized = scope.trim().toLowerCase();
return normalized == 'offline' || normalized == 'offline_access';
}
List<String> filterConsentScopes(Iterable<String> scopes) {
return scopes
.map((scope) => scope.trim())
.where((scope) => scope.isNotEmpty && !isRefreshTokenScopeAlias(scope))
.toList(growable: false);
}