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

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

Spotify provider requires client ID and client secret

To use Spotify sign in, you need a client ID and client secret obtained from the Spotify Developer Portal at https://developer.spotify.com/dashboard/applications.

Spotify does not support localhost redirect URI

Spotify no longer supports localhost as a redirect URI. You must use 127.0.0.1 for local development. The redirect URL must be set to http://127.0.0.1:3000/api/auth/callback/spotify in the Spotify Dashboard, and you must access your local app via http://127.0.0.1:3000 (not localhost:3000) so the browser URL matches the redirect URI exactly.

Spotify redirect URI format for production

For production, set the redirect URI to the URL of your application and it must be HTTPS. If you change the base path of the auth routes, you should update the redirect URL accordingly.

Spotify provider configuration example

To configure the Spotify provider, import the provider and pass it to the socialProviders option of the auth instance. Set BETTER_AUTH_URL environment variable to http://127.0.0.1:3000 for local development. The configuration in auth.ts should include: spotify object with clientId set to process.env.SPOTIFY_CLIENT_ID and clientSecret set to process.env.SPOTIFY_CLIENT_SECRET.

Spotify sign-in using signIn.social function

To sign in with Spotify, use the signIn.social function from the auth client with the provider property set to 'spotify'. The code is: const data = await authClient.signIn.social({ provider: 'spotify' })

Give your agent this brain