Skip to content

Commit 49042f1

Browse files
committed
fix: recap session capability object fixes
1 parent 64a9fc7 commit 49042f1

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

packages/auth-helpers/src/lib/recap/recap-session-capability-object.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1+
import { SiweMessage } from 'siwe';
2+
import { Recap } from 'siwe-recap';
3+
14
import {
25
InvalidArgumentException,
3-
RemovedFunctionError,
6+
LIT_ABILITY_VALUES,
47
} from '@lit-protocol/constants';
5-
import depd from 'depd';
6-
import { SiweMessage } from 'siwe';
7-
import { Recap } from 'siwe-recap';
8-
import { LIT_ABILITY_VALUES } from '@lit-protocol/constants';
98
import { ILitResource, ISessionCapabilityObject } from '@lit-protocol/types';
10-
import { AttenuationsObject, CID as CIDString } from '../models';
9+
1110
import { getRecapNamespaceAndAbility } from './utils';
11+
import { AttenuationsObject, CID as CIDString } from '../models';
1212
import { sanitizeSiweMessage } from '../siwe/siwe-helper';
1313

14-
const deprecated = depd('lit-js-sdk:auth-recap:session-capability-object');
15-
1614
export class RecapSessionCapabilityObject implements ISessionCapabilityObject {
1715
private _inner: Recap;
1816

@@ -27,15 +25,15 @@ export class RecapSessionCapabilityObject implements ISessionCapabilityObject {
2725
const recap = Recap.decode_urn(encoded);
2826
return new this(
2927
recap.attenuations,
30-
recap.proofs.map((cid: any) => cid.toString())
28+
recap.proofs.map((cid) => cid.toString())
3129
);
3230
}
3331

3432
static extract(siwe: SiweMessage): RecapSessionCapabilityObject {
3533
const recap = Recap.extract_and_verify(siwe);
3634
return new this(
3735
recap.attenuations,
38-
recap.proofs.map((cid: any) => cid.toString())
36+
recap.proofs.map((cid) => cid.toString())
3937
);
4038
}
4139

@@ -44,7 +42,7 @@ export class RecapSessionCapabilityObject implements ISessionCapabilityObject {
4442
}
4543

4644
get proofs(): Array<CIDString> {
47-
return this._inner.proofs.map((cid: any) => cid.toString());
45+
return this._inner.proofs.map((cid) => cid.toString());
4846
}
4947

5048
get statement(): string {

packages/auth-helpers/src/lib/siwe/siwe-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const addRecapToSiweMessage = async ({
7777
recapObject.addCapabilityForResource(
7878
request.resource,
7979
request.ability,
80-
request.data || null
80+
request.data
8181
);
8282

8383
const verified = recapObject.verifyCapabilitiesForResource(

0 commit comments

Comments
 (0)