Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/cli-kit/src/private/node/session/scopes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {allAPIs, API} from '../api.js'
import {BugError} from '../../../public/node/error.js'
import {uniq} from '../../../public/common/array.js'

/**
* Generate a flat array with all the default scopes for all the APIs plus
Expand All @@ -10,7 +11,7 @@ import {BugError} from '../../../public/node/error.js'
export function allDefaultScopes(extraScopes: string[] = []): string[] {
let scopes = allAPIs.map((api) => defaultApiScopes(api)).flat()
scopes = ['openid', ...scopes, ...extraScopes].map(scopeTransform)
return Array.from(new Set(scopes))
return uniq(scopes)
}

/**
Expand All @@ -22,7 +23,7 @@ export function allDefaultScopes(extraScopes: string[] = []): string[] {
*/
export function apiScopes(api: API, extraScopes: string[] = []): string[] {
const scopes = [...defaultApiScopes(api), ...extraScopes.map(scopeTransform)].map(scopeTransform)
return Array.from(new Set(scopes))
return uniq(scopes)
}

/**
Expand Down
Loading