Skip to main content
Glama

Storyden

by Southclaws
Mozilla Public License 2.0
227
utils.ts1.06 kB
import { startAuthentication, startRegistration, } from "@simplewebauthn/browser"; import "client-only"; import { webAuthnGetAssertion, webAuthnMakeAssertion, webAuthnMakeCredential, webAuthnRequestCredential, } from "src/api/openapi-client/auth"; import { WebAuthnMakeAssertionBody, WebAuthnMakeCredentialBody, } from "@/api/openapi-schema"; export async function passkeyLogin(handle: string) { const { publicKey } = await webAuthnGetAssertion(handle); const credential = await startAuthentication(publicKey); // HACK: // 1. https://github.com/MasterKale/SimpleWebAuthn/issues/330 // 2. https://github.com/go-webauthn/webauthn/issues/93 credential.response.userHandle = undefined; await webAuthnMakeAssertion(credential as WebAuthnMakeAssertionBody); } export async function passkeyRegister(handle: string) { const { publicKey } = await webAuthnRequestCredential(handle); const credential = await startRegistration({ ...publicKey, }); await webAuthnMakeCredential(credential as WebAuthnMakeCredentialBody); }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Southclaws/storyden'

If you have feedback or need assistance with the MCP directory API, please join our Discord server