0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

fix(core): fix scope resource finder (#2962)

This commit is contained in:
wangsijie 2023-01-17 11:56:18 +08:00 committed by GitHub
parent ea7e8303c0
commit 2722704a2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,7 +48,7 @@ export default function roleScopeRoutes<T extends AuthedRouter>(
const resources = await findResourcesByIds(scopes.map(({ resourceId }) => resourceId)); const resources = await findResourcesByIds(scopes.map(({ resourceId }) => resourceId));
const result: ScopeResponse[] = scopes.map((scope) => { const result: ScopeResponse[] = scopes.map((scope) => {
const resource = resources.find(({ id }) => scope.resourceId); const resource = resources.find(({ id }) => id === scope.resourceId);
assertThat(resource, new Error(`Cannot find resource for id ${scope.resourceId}`)); assertThat(resource, new Error(`Cannot find resource for id ${scope.resourceId}`));