chore: add custom-jwt-validation example #40438
Merged
+155
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Same as supabase/edge-runtime#642
Description
What kind of change does this PR introduce?
docs update
What is the new behaviour?
Since jwt verification will be deprecated, users should use
--no-verify-jwtand do verification by their selves.This PR adds some templates for jwt token verification.
Additional context
Note
Adds a custom JWT validation example with shared middleware for Supabase default auth and Clerk, plus setup docs.
examples/edge-functions/supabase/functions/_shared/jwt/:default.ts: verifies Supabase JWTs usingJWT_SECRETwithjoseand exportsAuthMiddleware.clerk.ts: verifies Clerk-issued JWTs via remote JWKs (AUTH_THIRD_PARTY_CLERK_DOMAIN) and exportsAuthMiddleware.custom-jwt-validation/:index.ts: demonstrates wrapping a handler withAuthMiddleware(default provider by default).README.md: instructions for copying templates and required env vars.Written by Cursor Bugbot for commit acd3949. This will update automatically on new commits. Configure here.