-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If custom "aud" claim is added to session token, getAuth() fails in getServerSideProps #1507
Comments
Hello @Richard87 and thank you for the feedback. Also based on your snippets and the error message it seems that even though the Could you take a look at the above and let me know if your issue is resolved? Some extra notes:
|
@dimkl Thanks for helping out, will useUser or useSession also trigger request rate limits? I see they both also include the User object? Is there a way to get the current session token/claims without useUser/useSession? |
@Richard87 I believe that Do you need the current session token/claims in the server? |
Hi, @dimkl , thanks thats what I need to know! I have When I upgraded Clerk and added |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Frontend API:
pk_test_cGVyZmVjdC1nb3JpbGxhLTk4LmNsZXJrLmFjY291bnRzLmRldiQ
Package + Version
@clerk/clerk-js
@clerk/clerk-react
@clerk/nextjs
@clerk/remix
@clerk/types
@clerk/themes
@clerk/localizations
@clerk/clerk-expo
@clerk/backend
@clerk/clerk-sdk-node
@clerk/shared
@clerk/fastify
@clerk/chrome-extension
gatsby-plugin-clerk
build/tooling/chore
Dependencies + versions
Provide a json with the dependencies used in your project (copy paste from yarn.lock / package-lock.json) or a github project / template that reproduces the issue.
Include the @clerk/ packages and their versions!*
Example:
Browser/OS
Chrome:
Versjon 114.0.5735.198 (Offisiell delversjon) (arm64)
Node:
v16.20.1
Cloudflare worker: no idea how to check
Description
When a custom "aud" claim is added to the session token:
Invalid JWT audience claim (aud) \"http://localhost:3000\". Expected \"undefined\". Make sure that this is a valid Clerk generate JWT. (reason=token-verification-failed, token-carrier=cookie)",
My
pages/minside/test
file:Note: This works great without the custom
aud
, but its required for the backend apiMy
pages/_app.tsx
file:And my middleware.ts file:
The text was updated successfully, but these errors were encountered: