Get credentials
1
Create an app
Go to Reddit App Preferences and scroll to the bottom. Click Create another app…. Select web app as the type and add your redirect URI:Configuration
lib/theauth.ts
Endpoints
Scopes
Default scope:identity. Scopes you pass are added on top of the default.
User data returned
Reddit’s token endpoint uses HTTP Basic authentication rather than posting credentials in the request body. theAuth handles this automatically.
Handling missing email
Theoauth() plugin matches or creates a theAuth user by email. Because Reddit returns none, a Reddit callback does not produce a session: the provider account is stored without a user, and the callback responds with JSON (isNewAccount, account, userInfo) instead of redirecting. The same happens on later sign-ins with that account.
To support Reddit sign-in you need to collect an email yourself and attach the account to a user, for example with POST /auth/oauth/link from an authenticated session or linkAccount on a module built with createOAuthModule.
Related
OAuth overview
Generic OAuth 2.0 setup and account linking behavior.
Discord
Another community-focused OAuth provider.
GitHub
Developer-focused OAuth provider with similar setup.
Authentication overview
All sign-in methods available in theAuth.