Skip to content

Commit f7359a0

Browse files
committed
fix(identities): claiming an identity that is not authenticated results in ErrorProviderIdentity that also shows the authenticated identities
1 parent b6f75b0 commit f7359a0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/identities/IdentitiesManager.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ class IdentitiesManager {
243243
}
244244
const identities = await provider.getAuthIdentityIds();
245245
if (!identities.includes(identityId)) {
246-
throw new identitiesErrors.ErrorProviderUnauthenticated();
246+
throw new identitiesErrors.ErrorProviderIdentityMissing(
247+
`Authenticated identities: ${JSON.stringify(identities)}`
248+
);
247249
}
248250
// Create identity claim on our node
249251
const publishedClaimProm = promise<IdentitySignedClaim>();

src/identities/errors.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ class ErrorProviderUnauthenticated<T> extends ErrorIdentities<T> {
3838
exitCode = sysexits.NOPERM;
3939
}
4040

41+
class ErrorProviderIdentityMissing<T> extends ErrorIdentities<T> {
42+
static description = 'Identity is not authenticated with the provider';
43+
exitCode = sysexits.NOPERM;
44+
}
45+
4146
class ErrorProviderUnimplemented<T> extends ErrorIdentities<T> {
4247
static description = 'Functionality is unavailable';
4348
exitCode = sysexits.USAGE;
@@ -58,5 +63,6 @@ export {
5863
ErrorProviderAuthentication,
5964
ErrorProviderUnauthenticated,
6065
ErrorProviderUnimplemented,
66+
ErrorProviderIdentityMissing,
6167
ErrorProviderMissing,
6268
};

0 commit comments

Comments
 (0)