Skip to content

Commit efe8e2c

Browse files
vveerrggclaude
andcommitted
fix: resolve TypeScript build errors for AuthenticatorTransport and bech32 types
- Cast transports to AuthenticatorTransport[] for StoredCredential compatibility - Add template literal type assertion for bech32.decode npub parameter Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8dee11c commit efe8e2c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/server/webauthn.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export class WebAuthnServer {
151151
counter: registrationInfo.counter,
152152
credentialBackedUp: registrationInfo.credentialBackedUp,
153153
credentialDeviceType: registrationInfo.credentialDeviceType,
154-
transports: credential.response.transports as AuthenticatorTransportFuture[] | undefined,
154+
transports: credential.response.transports as unknown as AuthenticatorTransport[] | undefined,
155155
};
156156

157157
this.credentials.set(userId, [...userCreds, storedCredential]);

src/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function npubToHex(npub: string): string {
1515
}
1616
// Decode the full bech32 string directly — npub1... is already valid bech32
1717
// with 'npub' as the human-readable part and '1' as the separator
18-
const decoded = bech32.decode(npub, 1500);
18+
const decoded = bech32.decode(npub as `npub1${string}`, 1500);
1919
const pubkeyBytes = bech32.fromWords(decoded.words);
2020
return Buffer.from(pubkeyBytes).toString('hex');
2121
} catch (error) {

0 commit comments

Comments
 (0)