CodingWithJamal
CodingWithJamal6mo ago

Convex Auth Discord Setup

Im trying to get convex auth to work with discord. I thought i followed everything correctly and i get no errors in the console?
No description
No description
5 Replies
CodingWithJamal
CodingWithJamalOP6mo ago
import { convexAuth } from "@convex-dev/auth/server";
import Discord from "@auth/core/providers/discord";

export const { auth, signIn, signOut, store } = convexAuth({
providers: [
Discord({
clientId: process.env.DISCORD_AUTH_CLIENT_ID,
clientSecret: process.env.DISCORD_AUTH_CLIENT_SECRET,
}),
],
session: {
totalDurationMs: 30 * 24 * 60 * 60 * 1000, // 30 days
inactiveDurationMs: 30 * 24 * 60 * 60 * 1000, // 30 days
},
jwt: {
durationMs: 60 * 60 * 1000, // 1 hour
},
callbacks: {
redirect: undefined,
},
});
import { convexAuth } from "@convex-dev/auth/server";
import Discord from "@auth/core/providers/discord";

export const { auth, signIn, signOut, store } = convexAuth({
providers: [
Discord({
clientId: process.env.DISCORD_AUTH_CLIENT_ID,
clientSecret: process.env.DISCORD_AUTH_CLIENT_SECRET,
}),
],
session: {
totalDurationMs: 30 * 24 * 60 * 60 * 1000, // 30 days
inactiveDurationMs: 30 * 24 * 60 * 60 * 1000, // 30 days
},
jwt: {
durationMs: 60 * 60 * 1000, // 1 hour
},
callbacks: {
redirect: undefined,
},
});
Heres is my auth setup code the env variables are loaded in the dashboard as well
CodingWithJamal
CodingWithJamalOP6mo ago
No description
erquhart
erquhart6mo ago
from the docs, path sould start with /api/auth (missing the api segment) (and "from the docs" because I still haven't actually implemented convex auth myself)
CodingWithJamal
CodingWithJamalOP6mo ago
ah okay... i think the code example was missing that part idk thanks
Michal Srb
Michal Srb6mo ago
@CodingWithJamal which doc has the wrong snippet? so we can fix it

Did you find this page helpful?