Skip to content
Discussion options

You must be logged in to vote

Yes I did! My approach is probably less than ideal, but it works perfectly for what I'm doing. Ideally one would use a custom passport strategy (which I sort of had going above), but I wasn't able to fully get it. My approach has been working very well in production though:

This util will simply take the Clerk session token passed in the request auth header (or will attempt to get from cookies if no auth header) and decode/verify it using Clerk backend. (make sure CLERK_SECRET_KEY env variable is set).

// src/util/verifyClerkUser.ts
import { sessions } from "@clerk/clerk-sdk-node";
import { decodeJwt } from "@clerk/clerk-sdk-node";
import { PayloadRequest } from "payload/types";

export d…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@isaackoz
Comment options

Answer selected by isaackoz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants