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

Commit

Permalink
Check if existing userId is valid before throwing error
Browse files Browse the repository at this point in the history
  • Loading branch information
CITIZENDOT committed Aug 16, 2024
1 parent 983bcfc commit edae5c1
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit edae5c1

Please sign in to comment.