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

Check if existing userId is valid before throwing error #10981

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async function checkTokenAuth(context: HookContext<IdentityProviderService>, use

if (key.data.length > 0) {
const user = await context.app.service(userPath).get(key.data[0].userId)
if (userId !== user.id) throw new BadRequest('Cannot make identity-providers on other users')
if (userId && userId !== user.id) throw new BadRequest('Cannot make identity-providers on other users')
else return true
}
}
Expand Down
Loading