eric
eric3mo ago

BUG: Convex Auth Instagram Login - pkce cookie is missing

I'm getting this msg after trying to authorize the callback webhook on https://developers.facebook.com/ I have set the instagram app and env (on convex) as said in the convex auth (and auth.js) docs. here is the error: Oct 14, 15:18:54 H GET /api/auth/callback/instagram error 'pkce cookie is missing. at use [as use] (../../node_modules/@convex-dev/auth/dist/server/checks.js:73:8) at handleOAuthCallback (../../node_modules/@convex-dev/auth/dist/server/oauth.js:123:28) at async <anonymous> (../../node_modules/@convex-dev/auth/dist/server/implementation/index.js:187:63) at async invokeFunction (../../node_modules/convex/src/server/impl/registration_impl.ts:80:11) at async invokeHttpAction (../../node_modules/convex/src/server/impl/registration_impl.ts:447:0) at async <anonymous> (../../node_modules/convex/src/server/router.ts:322:16)' Oct 14, 15:18:54 H GET /api/auth/callback/* 302 212ms
Meta for Developers
Social technologies | Meta for Developers
Social technologies that help developers grow, build community and monetize their apps.
No description
6 Replies
Convex Bot
Convex Bot3mo ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
eric
ericOP3mo ago
I'm using "@auth/core": "^0.36.0", "@convex-dev/auth": "^0.0.72",
ballingt
ballingt3mo ago
@eric do you think the pkce cookie is not missing? Does the network request contain this cookie? I wonder if other folks have had success with the Facebook auth strategy, I don't see any issues
eric
ericOP3mo ago
I've also tried this on auth.config.ts : export default { providers: [ { domain: process.env.CONVEX_SITE_URL, applicationID: "convex", }, ], cookies: { pkceCodeVerifier: { name: "next-auth.pkce.code_verifier", options: { httpOnly: true, sameSite: "none", path: "/", secure: true, }, }, csrfToken: { name: "next-auth.csrf-token", options: { httpOnly: true, sameSite: "none", path: "/", secure: true, }, }, }, };
sshader
sshader3mo ago
Your auth.config.ts should look something like
export default {
providers: [
{
domain: process.env.CONVEX_SITE_URL,
applicationID: "convex",
},
],
};
export default {
providers: [
{
domain: process.env.CONVEX_SITE_URL,
applicationID: "convex",
},
],
};
(there are no other supported parameters) Your auth.ts should configure whichever Auth.js providers you want, so maybe something like
import { convexAuth } from "@convex-dev/auth/server";
import Instagram from "@auth/core/providers/instagram";

export const { auth, signIn, signOut, store } = convexAuth({
providers: [Instagram],
});
import { convexAuth } from "@convex-dev/auth/server";
import Instagram from "@auth/core/providers/instagram";

export const { auth, signIn, signOut, store } = convexAuth({
providers: [Instagram],
});
I don't believe Convex Auth supports custom cookie configuration at the moment
eric
ericOP3mo ago
I guess this bug is on Auth.js I had the same problem with just the auth.js using prisma and pg db.

Did you find this page helpful?