Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const grantedScopesExplanations = useMemo(
() =>
explanations && grantedScopes
? match(explanations, grantedScopes, {
currentAuthorizationId: null,
currentGrantId: grantId,
currentUserId: userId,
currentClientId: clientId
})
: [],
[explanations, grantedScopes, clientId, grantId, userId]
);
const newRequestedScopes =
grant && grant.scopes
? getDifference(
grant.scopes.filter(s => overrides[s] !== false),
requestedScopes
)
: requestedScopes;
const newRequestedScopesExplanations = useMemo(
() =>
explanations
? match(explanations, newRequestedScopes, {
currentAuthorizationId: null,
currentGrantId: grantId,
currentUserId: userId,
currentClientId: clientId
})
: [],
[explanations, newRequestedScopes, clientId, grantId, userId]