hari5h
hari5h
CCConvex Community
Created by hari5h on 9/24/2024 in #support-community
Discord OAuth reauthorization
That's a good idea, thanks! Had a play around a figured it out if anyone else is stuck. Found a way to do it by passing in a custom authorization value when setting up the provider
import { convexAuth } from "@convex-dev/auth/server";
import Discord from "@auth/core/providers/discord";
import GitHub from "@auth/core/providers/github";

const DISCORD_AUTHORIZATION_URL =
"https://discord.com/api/oauth2/authorize?scope=identify+email&prompt=none";

export const { auth, signIn, signOut, store } = convexAuth({
providers: [
Discord({
authorization: DISCORD_AUTHORIZATION_URL,
}),
GitHub,
],
});
import { convexAuth } from "@convex-dev/auth/server";
import Discord from "@auth/core/providers/discord";
import GitHub from "@auth/core/providers/github";

const DISCORD_AUTHORIZATION_URL =
"https://discord.com/api/oauth2/authorize?scope=identify+email&prompt=none";

export const { auth, signIn, signOut, store } = convexAuth({
providers: [
Discord({
authorization: DISCORD_AUTHORIZATION_URL,
}),
GitHub,
],
});
4 replies