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

Better Auth · Authentication · all subjects

social sign-on/github

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

GitHub OAuth app setup redirect URL

To use GitHub sign in, set the redirect URL to http://localhost:3000/api/auth/callback/github for local development. For production, set it to your application URL. If the base path of the auth routes changes, update the redirect URL accordingly.

GitHub app must include user:email scope

The user:email scope is required in the GitHub app configuration for Better Auth to work correctly.

GitHub OAuth provider configuration

Configure GitHub OAuth by importing betterAuth and passing the provider to the socialProviders option with clientId and clientSecret from environment variables. Example: github: { clientId: process.env.GITHUB_CLIENT_ID, clientSecret: process.env.GITHUB_CLIENT_SECRET }

GitHub sign in with client

Use the authClient.signIn.social() function with provider set to 'github' to initiate GitHub sign in.

GitHub app email permission setup

For GitHub apps (as opposed to OAuth apps), you must enable email reading. Go to Permissions and Events > Account Permissions > Email Addresses and select 'Read-Only', then save changes.

email_not_found error causes

The email_not_found error occurs when either (a) you created a GitHub App and did not grant the 'Email addresses: Read-only' permission, or (b) the user set their primary email to private, in which case the API returns email: null. The user's private email addresses are available via the /user/emails endpoint.

GitHub OAuth tokens do not refresh

GitHub does not issue refresh tokens for OAuth apps. GitHub issues access tokens that remain valid indefinitely unless the user revokes them, the app revokes them, or they go unused for a year. No refresh token is needed because GitHub access tokens do not expire on a short interval like Google or Discord.

Give your agent this brain