Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Updated verify project permission hook to look for context.id as well
Browse files Browse the repository at this point in the history
  • Loading branch information
hanzlamateen committed Jun 3, 2024
1 parent c3fb0ae commit fa126cf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/server-core/src/hooks/verify-project-permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ export default (types: string[]) => {

if (!loggedInUser) throw new NotAuthenticated('No logged in user')

const projectId = context.params.query.projectId ?? context.data.projectId
let projectId = ''
if (context.params.query?.projectId) {
projectId = context.params.query.projectId
} else if (context.data?.projectId) {
projectId = context.data.projectId
} else if (context.id) {
projectId = context.id.toString()
}

if (!projectId) throw new BadRequest('Missing project ID in request')

Expand Down

0 comments on commit fa126cf

Please sign in to comment.