Set up Discord
Create the OAuth App, register the redirect URI and collect the login variables.
Discord OAuth is the only way to sign in to OpenCall β there is no email/password sign-up. NextAuth handles the session, so besides the Application credentials you only need a session secret and the app's public URL.
1. Create the Application
New Application β give it a name (e.g. your community's name).
Go to OAuth2 (side menu). Copy:
- Client ID β
DISCORD_CLIENT_ID - Client Secret β
DISCORD_CLIENT_SECRET(click "Reset Secret" if it does not show up right away)

2. Register the Redirect URI
Still under OAuth2 β Redirects, add:
https://YOUR-DOMAIN/api/auth/callback/discord
Replace YOUR-DOMAIN with the domain where Next.js will run (see Production deploy (Railway)). Without that exact URL registered, login fails
with redirect_uri_mismatch.
To run the app locally as well, add
http://localhost:3000/api/auth/callback/discord as a second redirect.
Variables from this step
| Variable | Value |
|---|---|
DISCORD_CLIENT_ID | Client ID from step 1 |
DISCORD_CLIENT_SECRET | Client Secret from step 1 |
NEXTAUTH_SECRET and NEXTAUTH_URL are also required for login to work β see
Generate the session secret.