How to obtain cookies in Convex Auth ConvexCredentials authorize?
Hi there, is it somehow possible to get the cookies inside ConvexCredentials authorize? I need to get them to verify the credentials. In NextAuth there is the req parameter in authorize. Your http actions have it as well.
2 Replies
Convex Auth mostly uses actions (as opposed to HTTP actions), so they don't have access to cookies. We use local storage for the most client side secret storage (see https://labs.convex.dev/auth/security#client-secrets-storage).
Can you say more about why you need to use cookies here? Generally you'd need some sort of proxy between whatever is serving your frontend code + Convex in order to use cookies (e.g. NextJS middleware)
Keep your authentication secure - Convex Auth
Authentication library for your Convex backend
Ah yeah, totally forgot the third party cookie aspect. Thanks. I solved it now by using convex helper sessions and will post a full example repo here soon.