Skip to content

Commit 336b556

Browse files
committed
fix: make ensureIdentityOwner message more specific
1 parent 38e5612 commit 336b556

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

libs/api/identity/data-access/src/lib/api-identity-solana.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,16 @@ export class ApiIdentitySolanaService {
7676
async ensureIdentityOwner(ownerId: string, provider: IdentityProvider, providerId: string) {
7777
const found = await this.core.data.identity.findFirst({
7878
where: {
79-
ownerId,
8079
provider,
8180
providerId,
8281
},
8382
})
8483
if (!found) {
8584
throw new Error(`Identity ${provider} ${providerId} not found`)
8685
}
86+
if (found.ownerId !== ownerId) {
87+
throw new Error(`Identity ${provider} ${providerId} is not owned by ${ownerId}`)
88+
}
8789
return found
8890
}
8991

libs/web/identity/data-access/src/lib/identity-provider-solana-link.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function IdentityProviderSolanaLink({ children, refresh }: { children: Re
3232
})
3333
.catch((err) => {
3434
console.log('Error linking identity', err)
35-
toastError('Error linking identity')
35+
toastError(err)
3636
})
3737
}
3838

@@ -48,7 +48,7 @@ export function IdentityProviderSolanaLink({ children, refresh }: { children: Re
4848
})
4949
.catch((err) => {
5050
console.log('error linking identity', err)
51-
toastError('Error linking identity')
51+
toastError(err)
5252
})
5353
}
5454

0 commit comments

Comments
 (0)