Describe the bug
I am using t3-app and I would like to check the user's role in the trpc`s middleware.
I added an auth object this way
const auth = getAuth(opts.req as RequestLike);
Unfortunately the user in the auth object is undefined. Is it a bug, or I need some additional coding to get the user object and role in privateMetadata?
Is it the same issue in the next middleware, in the withClerkMiddleware() function.
const { user, userId, } = getAuth(request);
User object is undefined.
To Reproduce
Expected behavior
User object is populated.
Logs
Please provide logs showing the error.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Describe the bug I am using t3-app and I would like to check the user's role in the trpc`s middleware. I added an auth object this way
Unfortunately the user in the auth object is undefined. Is it a bug, or I need some additional coding to get the user object and role in privateMetadata? Is it the same issue in the next middleware, in the withClerkMiddleware() function.
User object is undefined.
To Reproduce
Expected behavior User object is populated.
Logs Please provide logs showing the error.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context