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/railway

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.

Railway provider configuration

To configure Railway as a social provider, import betterAuth and pass a configuration object to the socialProviders option with the provider key 'railway', containing clientId and clientSecret from environment variables.

Railway OAuth App creation steps

To create a Railway OAuth App: 1. Go to Railway account's Developer Settings at https://railway.com/workspace/developer. 2. Click 'Create OAuth App'. 3. Set the Application Type to 'Web Application'. 4. Set the redirect URL to http://localhost:3000/api/auth/callback/railway for local development, or your application URL for production. If you change the base path of the auth routes, update the redirect URL accordingly.

Railway PKCE support

Railway uses PKCE (Proof Key for Code Exchange) for enhanced security. Better Auth automatically handles PKCE for Railway OAuth.

Railway sign-in with signIn.social

To sign in with Railway, use the authClient.signIn.social function with the provider set to 'railway'. This is called from the client after creating an auth client using createAuthClient().

Railway OAuth scopes

Railway OAuth supports the following scopes: openid (required for all requests, included by default), email (access user's email address, included by default), profile (access user's name and picture, included by default), offline_access (receive refresh tokens for long-lived access), workspace:viewer (viewer access to user-selected workspaces), workspace:member (member access to user-selected workspaces), workspace:admin (admin access to user-selected workspaces), project:viewer (viewer access to user-selected projects), project:member (member access to user-selected projects). When requesting workspace or project scopes, users will select which specific workspaces or projects to share during the consent screen.

Railway scope configuration example

You can specify additional scopes when configuring the Railway provider by adding a scope array property to the configuration object.

Railway offline_access scope requires prompt=consent

When requesting the offline_access scope from Railway, you must set prompt: 'consent' in the Railway provider configuration to comply with Railway's OAuth requirements.

Railway offline_access with prompt configuration

When using offline_access scope with Railway, set the prompt option to 'consent' in the provider configuration.

Give your agent this brain