Skip to content

Commit

Permalink
fix: make ensureIdentityOwner message more specific
Browse files Browse the repository at this point in the history
  • Loading branch information
beeman committed Jan 15, 2025
1 parent 65a335d commit 52f0caf
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,16 @@ export class ApiIdentitySolanaService {
async ensureIdentityOwner(ownerId: string, provider: IdentityProvider, providerId: string) {
const found = await this.core.data.identity.findFirst({
where: {
ownerId,
provider,
providerId,
},
})
if (!found) {
throw new Error(`Identity ${provider} ${providerId} not found`)
}
if (found.ownerId !== ownerId) {
throw new Error(`Identity ${provider} ${providerId} not owned by ${found.ownerId}`)
}
return found
}

Expand Down

0 comments on commit 52f0caf

Please sign in to comment.