Skip to content

Commit dd2bac9

Browse files
committed
fmt
1 parent f6152f6 commit dd2bac9

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

packages/auth-helpers/src/lib/recap/utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ export function getLitAbilityFromRecap(params: {
9090
}
9191
}
9292

93-
if (recapNamespace === LIT_NAMESPACE.Auth && recapAbility === LIT_RECAP_ABILITY.Auth) {
93+
if (
94+
recapNamespace === LIT_NAMESPACE.Auth &&
95+
recapAbility === LIT_RECAP_ABILITY.Auth
96+
) {
9497
if (resourceKey.startsWith(PAYMENT_DELEGATION_PREFIX)) {
9598
return LIT_ABILITY.PaymentDelegation;
9699
}

packages/auth/src/lib/AuthManager/authAdapters/getPkpAuthContextFromPreGeneratedAdapter.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ const baseDelegation = ({
1111
}: {
1212
recap: Record<string, unknown>;
1313
}): AuthSig => {
14-
const resourcesLine = `- urn:recap:${Buffer.from(JSON.stringify(recap)).toString('base64url')}`;
14+
const resourcesLine = `- urn:recap:${Buffer.from(
15+
JSON.stringify(recap)
16+
).toString('base64url')}`;
1517

1618
const signedMessage = [
1719
'localhost wants you to sign in with your Ethereum account:',

packages/auth/src/lib/AuthManager/authAdapters/getPkpAuthContextFromPreGeneratedAdapter.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,13 @@ function extractAuthMetadataFromRestriction(
159159
function sanitiseRestrictionData(
160160
restriction: Record<string, unknown>
161161
): Record<string, DefinedJson> | undefined {
162-
const parsedData = Object.entries(restriction).reduce(
163-
(acc, [key, value]) => {
164-
const result = DefinedJsonSchema.safeParse(value);
165-
if (result.success) {
166-
acc[key] = result.data;
167-
}
168-
return acc;
169-
},
170-
{} as Record<string, DefinedJson>
171-
);
162+
const parsedData = Object.entries(restriction).reduce((acc, [key, value]) => {
163+
const result = DefinedJsonSchema.safeParse(value);
164+
if (result.success) {
165+
acc[key] = result.data;
166+
}
167+
return acc;
168+
}, {} as Record<string, DefinedJson>);
172169

173170
return Object.keys(parsedData).length > 0 ? parsedData : undefined;
174171
}
@@ -309,9 +306,7 @@ function extractAuthConfigFromDelegationAuthSig(delegationAuthSig: AuthSig): {
309306
const expirationMatch = siweMessage.match(/^Expiration Time: (.*)$/m);
310307
const expiration = expirationMatch ? expirationMatch[1].trim() : undefined;
311308

312-
const resourceMatches = [
313-
...siweMessage.matchAll(/-\s*(urn:recap:[^\s]+)/g),
314-
];
309+
const resourceMatches = [...siweMessage.matchAll(/-\s*(urn:recap:[^\s]+)/g)];
315310

316311
const resources: LitResourceAbilityRequest[] = [];
317312
let derivedAuthData: AuthData | undefined;

0 commit comments

Comments
 (0)