new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Supabase · Auth · all subjects

oauth providers/discord

8 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Discord OAuth setup overview

Setting up Discord logins consists of three parts: Create and configure a Discord Application in the Discord Developer Portal, add your Discord OAuth Consumer keys to your Supabase Project dashboard, and add the login code to your Supabase JS Client App.

Create Discord application for OAuth

To create a Discord application for OAuth: Click on 'New Application' at the top right in the Discord Developer Portal, enter the name of your application and click 'Create', click on 'OAuth2' under 'Settings' in the left side panel, click 'Add Redirect' under 'Redirects', type or paste your callback URL into the 'Redirects' box, click 'Save Changes' at the bottom, and copy your 'Client ID' and 'Client Secret' under 'Client information'.

Discord OAuth credentials to Supabase

Add your Discord Client ID and Client Secret to your Supabase project via the dashboard. Alternatively, use the Management API with a PATCH request to https://api.supabase.com/v1/projects/{PROJECT_REF}/config/auth with headers 'Authorization: Bearer {access-token}' and 'Content-Type: application/json', and body containing 'external_discord_enabled': true, 'external_discord_client_id': your-discord-client-id, and 'external_discord_secret': your-discord-client-secret.

Discord signInWithOAuth JavaScript example

import { createClient } from '@supabase/supabase-js' const supabase = createClient('https://your-project-id.supabase.co', 'sb_publishable_...') async function signInWithDiscord() { const { data, error } = await supabase.auth.signInWithOAuth({ provider: 'discord', }) }

Discord signInWithOAuth Flutter example

Future<void> signInWithDiscord() async { await supabase.auth.signInWithOAuth( OAuthProvider.discord, redirectTo: kIsWeb ? null : 'my.scheme://my-host', // Optionally set the redirect link to bring back the user via deeplink. authScreenLaunchMode: kIsWeb ? LaunchMode.platformDefault : LaunchMode.externalApplication, // Launch the auth screen in a new webview on mobile. ); }

Discord signInWithOAuth Kotlin example

suspend fun signInWithDiscord() { supabase.auth.signInWith(Discord) }

Discord SignIn C# example

var state = await supabase.Auth.SignIn(Provider.Discord); var signInUrl = state.Uri;

Discord re-authorization on sign in

If a user is already signed in with Discord, Discord will prompt the user again for authorization when they attempt to sign in.

Give your agent this brain