Skip to content

Fix encore + clerk ts template #193

Description

@paulwei-se

The typescripts tutorial at https://encore.dev/templates/clerk will result to an error if followed exactly.
ERR error="Failed to resolve JWK during verification." endpoint=myAuthHandler service=auth span_id=j6k6he3h81maq trace_id=8833e0movdg4acttoo6vga3qpo

according to Clerk document: https://clerk.com/docs/references/backend/verify-token#verify-token-options
verifyToken() at auth/auth.ts:35 must set the secretKey

The following code should fix it:

    const result = await verifyToken(token, {
      secretKey: clerkSecretKey(), // add this line
      authorizedParties: AUTHORIZED_PARTIES,
    });

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions