auth service repo.
The auth service makes AniList account linking work for /register.
What the auth service does
The auth service:- receives the signed OAuth context from the bot
- validates the context and creates a single-use OAuth state
- redirects the browser to AniList
- handles the AniList callback
- exchanges the auth code for AniList tokens
- fetches the AniList viewer ID and stores the linked credentials
- serves
GET /healthzfor liveness andGET /readyzfor database readiness
Before you start
You need an AniList OAuth application with a callback URL that points to the auth service. For local development, use:Configure the auth environment
From a workspace where the bot repo and auth repo are siblings:.env:
DATABASE_URL and OAUTH_CONTEXT_SIGNING_SECRET must match the bot service values. Keep USERID_HASH_SALT aligned too if you want matching hashed user identifiers across logs.Run the auth service locally
1
Create the auth database
Create the shared PostgreSQL database or connection target you want both services to use.
2
Start the service
3
Verify the health endpoints
Verify the OAuth flow
- Start the bot service.
- Run
/registerin Discord. - Click Link AniList Account.
- Complete the AniList flow in the browser.
- Run
/whoamito confirm the linked profile.
