The Discord provider configuresDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nuxt-alt/auth/llms.txt
Use this file to discover all available pages before exploring further.
@nuxt-alt/auth to authenticate users through Discord’s OAuth2 service. It uses the oauth2 scheme with the authorization code grant type and PKCE challenge method set to S256, providing an additional layer of security during the code exchange. Because the token endpoint requires a server-side request, the provider registers a Nuxt server route via addAuthorize (with PKCE enabled) to perform the exchange, keeping your clientSecret off the browser. The user profile is fetched from the Discord REST API after a successful login.
Required Options
| Option | Type | Description |
|---|---|---|
clientId | string | The Client ID of your Discord application |
clientSecret | string | The Client Secret of your Discord application |
Configuration
Auto-Configured Defaults
When the strategy name isdiscord, the provider automatically sets the following values. Any property you specify in your own config takes precedence.
| Property | Auto-Configured Value |
|---|---|
scheme | 'oauth2' |
endpoints.authorization | https://discord.com/api/oauth2/authorize |
endpoints.token | https://discord.com/api/oauth2/token |
endpoints.userInfo | https://discord.com/api/users/@me |
grantType | 'authorization_code' |
codeChallengeMethod | 'S256' |
scope | ['identify', 'email'] |
token.property | 'access_token' |
token.type | 'Bearer' |
token.name | 'Authorization' |
refreshToken.property | 'refresh_token' |
responseType | 'token' |
clientSecretTransport | 'body' |
Logging In
Trigger the Discord OAuth redirect from any component or composable:@nuxt-alt/auth fetches the user’s profile from the Discord API.
In your Discord application’s OAuth2 settings, add your application’s callback URL to the Redirects list. Navigate to the Discord Developer Portal, select your application, and go to OAuth2 → General. The default callback route used by
@nuxt-alt/auth is /login.