Replies: 2 comments
-
Did you figure out the solution for clerk? |
Beta Was this translation helpful? Give feedback.
0 replies
-
I also had this issue when migrating an existing t3 app to this structure and all i came up with is this lousy workaround: type SignedInAuthObject = {
sessionId: string;
userId: string;
};
type SignedOutAuthObject = {
sessionId: null;
userId: null;
};
type AuthObject = SignedInAuthObject | SignedOutAuthObject;
export const createTRPCContext = async (opts: {
headers: Headers;
auth: AuthObject;
token: string | null;
}) => {
return {
db,
...opts,
};
}; Basically defining your own types for the auth property... Works, if you dont need any of the other properties. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there,
I am replacing Next-auth with Clerk.
Here is the creation of TRPC context in the
api
packageHowever, by doing so I get the following type error:
I managed to solve the issue by modifying the
tsconfig
of the API package, but I guess ideally I should be able to set these properties as true:Here are the dependencies of the API package:
Did someone already manage to integrate Clerk without this issue ?
I'm not sure if this is an issue with my configuration, t3-turbo or Clerk package.
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions