Skip to content

Commit 37eac69

Browse files
committed
wip: getAuthContext
1 parent 87e5bf5 commit 37eac69

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

local-tests/setup/session-sigs/get-eoa-session-sigs.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ export const getEoaAuthContext = (
7474

7575
return authSig;
7676
},
77-
7877
...(centralisation === 'decentralised' && {
7978
capabilityAuthSigs: [devEnv.superCapacityDelegationAuthSig],
8079
}),

packages/auth/src/lib/AuthManager/getAuthContext.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ export interface AuthenticationContext {
1616
}
1717

1818
export interface GetAuthContextParams {
19-
authMethodType: AUTH_METHOD_TYPE_TYPE;
19+
authContextType: 'eoa' | 'pkp' | 'lit-action';
20+
pkpPublicKey: `0x${string}`;
2021
pkpAddress: `0x${string}`;
2122
litNodeClient: LitNodeClient;
2223
signer: {
@@ -28,18 +29,22 @@ export interface GetAuthContextParams {
2829
export const getAuthContext = (
2930
params: GetAuthContextParams
3031
): AuthenticationContext => {
31-
switch (params.authMethodType) {
32-
case 'EthWallet':
32+
switch (params.authContextType) {
33+
case 'eoa':
3334
return getEoaAuthContext({
3435
litNodeClient: params.litNodeClient,
3536
identity: {
36-
pkpPublicKey: params.pkpAddress,
37+
pkpPublicKey: params.pkpPublicKey,
3738
signer: params.signer,
3839
signerAddress: params.pkpAddress,
3940
},
4041
});
42+
// case 'pkp':
43+
// case 'lit-action':
4144
default:
42-
throw new Error(`Unsupported auth method type: ${params.authMethodType}`);
45+
throw new Error(
46+
`Unsupported auth method type: ${params.authContextType}`
47+
);
4348
}
4449
};
4550

0 commit comments

Comments
 (0)